P: n/a
|
objConn = New ADODB.Connection
objConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Dat a Source=" & dbPath _
& ";Jet OLEDB:Database Password=" & dbPassword)
This cause error: (VB.NET. )
sqlString = "insert into table1 " _
& "(Date1,Time,Ext,Co) values " _
& "('04/04/05','06:02PM','101','01');"
But below is fine
sqlString = "insert into table1 " _
& "(Date1,'Time1,Ext,Co) values " _
& "('04/04/05','06:02PM','101','01');"
That is , if I change the Access Table filed name
from "Date" -> Date1
"Time" -> "Time1". Then the above code run through fine.
But in my VB6 code before, I used the same TABLE Field Name and it works.
(That was a different VB project, of course) | |
Share this Question
P: n/a
|
Try enclosing Date and Time inside Square Brackets [Date], [Time] as they
are reserved words.
Doug
"devprog" <de*****@nospam.nospam> wrote in message
news:OX**************@TK2MSFTNGP15.phx.gbl... objConn = New ADODB.Connection objConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Dat a Source=" & dbPath _ & ";Jet OLEDB:Database Password=" & dbPassword)
This cause error: (VB.NET. )
sqlString = "insert into table1 " _ & "(Date1,Time,Ext,Co) values " _ & "('04/04/05','06:02PM','101','01');" But below is fine
sqlString = "insert into table1 " _ & "(Date1,'Time1,Ext,Co) values " _ & "('04/04/05','06:02PM','101','01');"
That is , if I change the Access Table filed name from "Date" -> Date1 "Time" -> "Time1". Then the above code run through fine.
But in my VB6 code before, I used the same TABLE Field Name and it works. (That was a different VB project, of course) | |
P: n/a
|
Hi Bell,
Thanks so much for the helping.
"Doug Bell" <du*@bigpond.com> wrote in message
news:ed**************@tk2msftngp13.phx.gbl... Try enclosing Date and Time inside Square Brackets [Date], [Time] as they are reserved words.
Doug "devprog" <de*****@nospam.nospam> wrote in message news:OX**************@TK2MSFTNGP15.phx.gbl... objConn = New ADODB.Connection objConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Dat a Source=" & dbPath _ & ";Jet OLEDB:Database Password=" & dbPassword)
This cause error: (VB.NET. )
sqlString = "insert into table1 " _ & "(Date1,Time,Ext,Co) values " _ & "('04/04/05','06:02PM','101','01');" But below is fine
sqlString = "insert into table1 " _ & "(Date1,'Time1,Ext,Co) values " _ & "('04/04/05','06:02PM','101','01');"
That is , if I change the Access Table filed name from "Date" -> Date1 "Time" -> "Time1". Then the above code run through fine.
But in my VB6 code before, I used the same TABLE Field Name and it
works. (That was a different VB project, of course)
| | This discussion thread is closed Replies have been disabled for this discussion. | | Question stats - viewed: 4182
- replies: 2
- date asked: Nov 21 '05
|