simple SQL statements
-
Hey people, I am having a really strange issue regarding SQL statements in my VB.NET code. The insert statement i have is INSERT INTO alarms(hour) VALUES (7) Now when I run the insert statement in a query from ACCESS it works fine no errors does what it needs to do. Yet, when I try to run it from my programm it says " ERROR IN INSERT INTO STATEMENT". Does anyone have any advice? I could really use it. Thanks for any help :)
-
Hey people, I am having a really strange issue regarding SQL statements in my VB.NET code. The insert statement i have is INSERT INTO alarms(hour) VALUES (7) Now when I run the insert statement in a query from ACCESS it works fine no errors does what it needs to do. Yet, when I try to run it from my programm it says " ERROR IN INSERT INTO STATEMENT". Does anyone have any advice? I could really use it. Thanks for any help :)
-
Hey people, I am having a really strange issue regarding SQL statements in my VB.NET code. The insert statement i have is INSERT INTO alarms(hour) VALUES (7) Now when I run the insert statement in a query from ACCESS it works fine no errors does what it needs to do. Yet, when I try to run it from my programm it says " ERROR IN INSERT INTO STATEMENT". Does anyone have any advice? I could really use it. Thanks for any help :)
give the table name as following. let "abc" is a table then the qry will be "insert into [abc] values(........)":-D
-
give the table name as following. let "abc" is a table then the qry will be "insert into [abc] values(........)":-D
Well thanks for the ideas but none of the two worked :( anyone have any other ideas as what it may be thats giving me such a hard time?
-
Hey people, I am having a really strange issue regarding SQL statements in my VB.NET code. The insert statement i have is INSERT INTO alarms(hour) VALUES (7) Now when I run the insert statement in a query from ACCESS it works fine no errors does what it needs to do. Yet, when I try to run it from my programm it says " ERROR IN INSERT INTO STATEMENT". Does anyone have any advice? I could really use it. Thanks for any help :)
Based on the information that you've given, the correct statement is
INSERT INTO alarms (hour) VALUES (7)
This assumes your database has a table called "alarms" with a column called "hour" that accepts an integer value. Double check the design of your database table to verify this. Also, we haven't seen your VB.NET code that your running around this statement. What sets it up and executes it? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Based on the information that you've given, the correct statement is
INSERT INTO alarms (hour) VALUES (7)
This assumes your database has a table called "alarms" with a column called "hour" that accepts an integer value. Double check the design of your database table to verify this. Also, we haven't seen your VB.NET code that your running around this statement. What sets it up and executes it? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
no that is not that way let abc is a table with coloum x,y,z then the statment where x is varchar or char y is a number and z is date will be "insert into [abc](x,y,z)values("' value of x "'," value of y ","' value of z '")" if u r using some control to input the values then use "insert into [abc](x,y,z)values('" & controlnameX.text & "'," & controalnameY.text & ",'" & controlname.textZ & "')"
-
no that is not that way let abc is a table with coloum x,y,z then the statment where x is varchar or char y is a number and z is date will be "insert into [abc](x,y,z)values("' value of x "'," value of y ","' value of z '")" if u r using some control to input the values then use "insert into [abc](x,y,z)values('" & controlnameX.text & "'," & controalnameY.text & ",'" & controlname.textZ & "')"
:wtf::omg::wtf::omg::wtf::omg::wtf::omg::wtf::omg::wtf::omg::wtf::wtf::wtf::omg::wtf: And this mean what to me? I'm not the one with the problem, and I'm probably one of the last people on this earth you should be preaching this crap to. I know how to build SQL procedures and how to integrate SQL with VB code. The person who originally posted the question has not given us enough information to give him a definitive answer to his problem. I told him to go back and double check the definition of the table against the SQL he's using as well as the BTW: I never use string concatentation to build SQL statements. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome