database question
-
I tried to access MS insert data from my VB code... The following Sql String gives error..... insert into table (name) values ('MyName') Note - the select, other queries work right... The querry executed in the MS Access worked to insert a record.... Help I was born intelligent
Education ruined me!. -
I tried to access MS insert data from my VB code... The following Sql String gives error..... insert into table (name) values ('MyName') Note - the select, other queries work right... The querry executed in the MS Access worked to insert a record.... Help I was born intelligent
Education ruined me!.What was the error (exception) that you got back? Can you show some code? The DB structure?
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
-
What was the error (exception) that you got back? Can you show some code? The DB structure?
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
Ray Cassick wrote: Can you show some code Dim db As Database Dim rs As Recordset Dim SQLString As String Set db = OpenDatabase("c:\temp\home.mdb") SQLString = "insert into expense (ExpName) values ('Hai')" Set rs = db.OpenRecordset(SQLString) If rs.BOF = True And rs.EOF = True Then MsgBox ("No Data") ........ The DB structure is simple.. with PKey as a auto number, ExpName as a text. Thats it... Any idea of my error.... Ray Cassick wrote: What was the error (exception) that you got back Run time error:3219 Invalid exception!! I was born intelligent
Education ruined me!. -
Ray Cassick wrote: Can you show some code Dim db As Database Dim rs As Recordset Dim SQLString As String Set db = OpenDatabase("c:\temp\home.mdb") SQLString = "insert into expense (ExpName) values ('Hai')" Set rs = db.OpenRecordset(SQLString) If rs.BOF = True And rs.EOF = True Then MsgBox ("No Data") ........ The DB structure is simple.. with PKey as a auto number, ExpName as a text. Thats it... Any idea of my error.... Ray Cassick wrote: What was the error (exception) that you got back Run time error:3219 Invalid exception!! I was born intelligent
Education ruined me!.Try using the Execute method of the dataabse object instead of the OpenRecordset method. db.Execute(SQLString)
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
-
Try using the Execute method of the dataabse object instead of the OpenRecordset method. db.Execute(SQLString)
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
Will give it a try... Thanks I was born intelligent
Education ruined me!.