Error in Database vb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JuAn2226
    New Member
    • Mar 2008
    • 27

    Error in Database vb

    [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.
    Code:
    If myvari = vbOK Then
        
        strSql1 = "INSERT INTO Results (TimeStart, TimeEnd, AverageSpeed, NumberOfCar)" & _
                                " VALUES ('" & frmDisplay.txtTimeStart.Text & "'," & _
                        " '" & frmDisplay.txtTimeEnd.Text & "','" & frmDisplay.lblAverage.Caption & "','" & frmDisplay.lblNum.Caption & "')"
                    DE.Conn.Execute strSql1
       End If
        Resume Next
    End If
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    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.

    -Stewart

    Comment

    Working...