|
Yes. You have three numeric fields in that table and your INSERT statement is treating them as strings. See the ' characters you're putting around those values??? Don't. And don't build the SQL statement the way you are now. Learn about parameterized queries and use them. Had you done so alreay, you may not have even seen this problem.
|
|
|
|
|
so should i change the statement? can You suggest me the right code..
the samples? please? cause i'm newbie..
thank You
|
|
|
|
|
Apparently you don't know anything about the SELECT statement format. For numeric fields, you don't put ' characters around the values.
|
|
|
|
|
Ya,you right specially bout the ' character,so could you give me the samples please? t
Thank you..
|
|
|
|
|
You're kidding, right? Ever hear of experimenting a little? It's the best way to teach yourself something. Make a little change, see what it does.
Dim query As String = "INSERT INTO table (numericField1, stringField1) VALUES (23, 'SomeString')"
BTW, the way you built your SQL statement is the worst possible method you could use to do it. Google for ".net parameterized query" and start reading. Seriously.
|
|
|
|
|
i know that statement.. i shouldn't put the ' character to numeric fields..
btw .net parameterized query thats for vb.net or vb?
|
|
|
|
|
VB.NET is what you're using, isn't it??
The concept is exactly the smae for any language.
|
|
|
|
|
No, i use VB..
Btw, can i ask again? How to delete record in DataGrid direct from DataGrid control when the program running,and it could effect to database, i use access database.. Thank you..
|
|
|
|
|
VB6?? If so, you'r using a dead language. One I haven't touched in over 10 years. So no, I can't tell you.
|
|
|
|
|
An idea:
Your program uses a COM component. The versions of that component differ on the computers, and between the versions the interface was broken.
But that's only an idea, due to the fact that you do not provide more information I cannot tell you more than this guess.
|
|
|
|
|
sorry, whats COM component?btw, i already write the code above..
thanks for your concern..
|
|
|
|
|
Hello,
For people out there who know and/or have Symantec, COMODO Antivirus, and some monitoring programs for school (for example: LanSchool or Netop Vision), when you go into task manager or other third-party utility or program you made of your own for process termination, if you select any of these programs, and try to terminate it, even with the process terminating utility running as admin , it gives you the message "Access denied!". I wonder how this is possible, I do have the Windows Service template for Visual Basic 2010 .NET, but I've been doing a lot of research on how this is possible, could there be a OnTerminate (Byval as ex, Byval ex) function or sub, if this is possible,I've heard of the O.S. Kernel drivers, could you make one? just wondering how these programs could do such a thing.....Any answers would be greatly appreciated
Regards,
Brandon T. H.
CodeProject Member
|
|
|
|
|
It's a genuine bad idea[^]. If you "really must", Google for "unkillable service" - StackOverflow has an archive on the topic.
Bastard Programmer from Hell
|
|
|
|
|
Not always true, COMODO has an exit function, user enters the password, prompts if the user really wanted to close the program, and it closes, automatically, then you could go to task manager and kill it's service from there without that "Access denied!" message. If COMODO was still running (it's program), then you would get that message.
|
|
|
|
|
I didn't say that it wasn't possible, only that it's a bad idea - and those keywords should be enough to find some interesting links. I'm not going to link to it directly, for the same reason that I don't like to key-loggers.
Bastard Programmer from Hell
|
|
|
|
|
Yeah there are some people out there who would LOVE, to integrate that into their pesky programs.
|
|
|
|
|
Brandon T. H. wrote: Not always true
Just because comodo does it doesn't make it a good idea.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Wes Aday wrote: Just because comodo does it doesn't make it a good idea.
True.
|
|
|
|
|
I'm using vb.net 2008 and ms access2007.
I create project connection with DB ms access saving by ms access2003
I want to create a code to show me the name of Table and Field in the DB
|
|
|
|
|
Mangore75 wrote: I want to create a code to show me the name of Table and Field in the DB
Which table? Any table[^]?
What have you tried so far?
Bastard Programmer from Hell
|
|
|
|
|
The Table in the DB(MyDB) which connection to my project :
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =" & Application.StartupPath & "\MyDB.mdb")
-Nothing
|
|
|
|
|
Which table? The database will have multiple tables, and I already posted the query that returns a list of all tables in that database.
What are you trying to achieve? Do you want to know which tables are in that database, or are you trying something else?
Bastard Programmer from Hell
|
|
|
|
|
I'm sorry I didn't know how to use this query in vb.net...
|
|
|
|
|
Are you having trouble with that specific query, or with queries in general in VB?
Bastard Programmer from Hell
|
|
|
|
|
Mangore75 wrote: I want to create a code to show me the name of Table and Field in the DB
You go right ahead and do that. Let us know how it goes.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|