By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,500 Members | 2,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,500 IT Pros & Developers. It's quick & easy.

Error in Database vb

P: 27
[ODBC MICROSOFT DRIVER] The INSERT INTO statement contain unknown file name: 'TimeStart'

i realy no idea how to solve this error because the TimeStart is excatly the name i use in the Results table. plz guide me.
Expand|Select|Wrap|Line Numbers
  1. If myvari = vbOK Then
  3.     strSql1 = "INSERT INTO Results (TimeStart, TimeEnd, AverageSpeed, NumberOfCar)" & _
  4.                             " VALUES ('" & frmDisplay.txtTimeStart.Text & "'," & _
  5.                     " '" & frmDisplay.txtTimeEnd.Text & "','" & frmDisplay.lblAverage.Caption & "','" & frmDisplay.lblNum.Caption & "')"
  6.                 DE.Conn.Execute strSql1
  7.    End If
  8.     Resume Next
  9. End If
Apr 27 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 2.5K+
P: 2,545
Hi. There are no apparent faults in the VB code you have shown or in the structure of your SQL statement, at least at first glance.

You are, however, appending all values as text strings, and I do wonder if the actual field types in your ODBC-connected table are strings??? It would be very unusual to define a start time, an end time and an average value as string values in an underlying table... It is possible that a type-conversion failure has occurred and the ODBC connection is returning a misleading error value.

Apr 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.