Click here to Skip to main content
15,916,189 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB Operating System Pin
Richard Andrew x6425-Oct-11 5:49
professionalRichard Andrew x6425-Oct-11 5:49 
AnswerRe: VB Operating System PinPopular
Richard MacCutchan25-Oct-11 6:05
mveRichard MacCutchan25-Oct-11 6:05 
AnswerRe: VB Operating System Pin
Smithers-Jones26-Oct-11 12:11
Smithers-Jones26-Oct-11 12:11 
GeneralRe: VB Operating System Pin
VOT Productions3-Nov-11 12:01
VOT Productions3-Nov-11 12:01 
AnswerRe: VB Operating System Pin
biop.codeproject13-Nov-11 17:08
biop.codeproject13-Nov-11 17:08 
QuestionTCP Socket client communication without using a buffer Pin
comiteco24-Oct-11 12:33
comiteco24-Oct-11 12:33 
AnswerRe: TCP Socket client communication without using a buffer Pin
Eddy Vluggen25-Oct-11 7:19
professionalEddy Vluggen25-Oct-11 7:19 
QuestionSyntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Amanjot23-Oct-11 15:17
Amanjot23-Oct-11 15:17 
Hi,
I am trying to populate access database with a small program in VB; however, getting the syntax error "Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'." If I remove the date filed in the database, the program works fine. Therefore, the problem seems in the date field.

In access database, the format of the date field is General

Here is the code:

VB
Dim mdate As Date
 mdate = "07/08/2011 12:00:00"
 Dim cmd As String = "insert into rawClimateData VALUES (" & mdate & ", 12:50 , " & TippingBucket & " , " & Precip & " , " & AirTemp & " , " & SolarRad & " , " & Evap & " , " & windSpeed & " , " & windDirection & " , " & SoilTemp & " , " & SnowDepth & " , " & RH & " , " & BaroPressure & " , " & BatteryVoltage & " , " & SoilMoisture & ")"
 MsgBox("cmd= " & cmd)
 dbCmd = New OleDbCommand(cmd, myConnection)
 dbCmd.ExecuteScalar()


Any help would be greatly appreciated.

Thanks,

Amanjot
AnswerRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
AspDotNetDev23-Oct-11 15:34
protectorAspDotNetDev23-Oct-11 15:34 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Amanjot23-Oct-11 16:03
Amanjot23-Oct-11 16:03 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
AspDotNetDev23-Oct-11 16:10
protectorAspDotNetDev23-Oct-11 16:10 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Amanjot25-Oct-11 16:45
Amanjot25-Oct-11 16:45 
AnswerRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
AspDotNetDev25-Oct-11 17:02
protectorAspDotNetDev25-Oct-11 17:02 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Amanjot30-Oct-11 6:05
Amanjot30-Oct-11 6:05 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
AspDotNetDev30-Oct-11 8:43
protectorAspDotNetDev30-Oct-11 8:43 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Amanjot31-Oct-11 9:53
Amanjot31-Oct-11 9:53 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
AspDotNetDev31-Oct-11 19:21
protectorAspDotNetDev31-Oct-11 19:21 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Hypermommy7-Nov-11 9:28
Hypermommy7-Nov-11 9:28 
AnswerRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
AspDotNetDev7-Nov-11 9:38
protectorAspDotNetDev7-Nov-11 9:38 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Hypermommy7-Nov-11 10:01
Hypermommy7-Nov-11 10:01 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Hypermommy7-Nov-11 10:16
Hypermommy7-Nov-11 10:16 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
AspDotNetDev7-Nov-11 10:43
protectorAspDotNetDev7-Nov-11 10:43 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Hypermommy8-Nov-11 3:44
Hypermommy8-Nov-11 3:44 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
AspDotNetDev23-Oct-11 15:37
protectorAspDotNetDev23-Oct-11 15:37 
GeneralRe: Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'. Pin
Luc Pattyn23-Oct-11 15:50
sitebuilderLuc Pattyn23-Oct-11 15:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.