2

I'm using VB6 and MS Access. my sql command is

insert into BatchInfo (BName,BDate,Currency) values('" & Me.txtBatchName.Text & "','" & Me.dtpBatchDate.Value & "','" & Me.cboCurrency.Text & "')

the output of the command at run time is

"insert into BatchInfo (BName,BDate,Currency) values('batch1','8/2/2012','AED')"

here is the schema of the BatchInfo Table

BatchID   AutoNumber
BName     Text
BDate     Date/Time
Currency  Text

I cannot find any syntax error. Please help.

4

3 に答える 3

0

二重引用符ではなく、単一引用符を使用しています。

これを試して

insert into BatchInfo (BName,BDate,Currency) values(""" & Me.txtBatchName.Text & """,#" & Me.dtpBatchDate.Value & #",""" & Me.cboCurrency.Text & """)
于 2012-08-03T15:25:15.100 に答える