I have a VB6 program that interfaces with a MS Access 2002 database. I am getting a "Runtime Error '2147217900 (80040e14)' Syntax error in FROM clause". I am out putting the sql in a message box and it is: SELECT * FROM [ALTER] WHERE [PROD] = 292611 I have verified that the product number 292611 is, in fact, in the Alter table of the CycleCount database. I looked for this code on the internet and I kept getting back that somehow it came across a NULL value. If anyone can help I would be greatly appreciative. Here's my code:

VB Code:
  1. '*INALTER()********************************************************************
  2. 'Name: inALTER()
  3. 'Desc: Returns true if the item is in the ALTER table, false otherwise
  4. Private Function inAlter(PROD As Double) As Boolean
  5.     Dim sql As String
  6.    
  7.     Set newConnection = New ADODB.connection
  8.     newConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  9.         "Data Source= C:\Documents and Settings\p6b0438\My Documents\CycleCount\DB\CycleCount.mdb"
  10.     newConnection.Open
  11.     Set newRecordSet = New ADODB.recordSet
  12.    
  13.     sql = "SELECT * " & _
  14.           "FROM [ALTER] " & _
  15.           "WHERE [PROD] = " & PROD
  16. MsgBox (sql)
  17.     newRecordSet.Open sql, newConnection, adOpenKeyset, adLockPessimistic, adCmdTable
  18. Debug.Print sql
  19.    
  20.     If (newRecordSet.RecordCount > 0) Then
  21.         inAlter = True
  22.     ElseIf (newRecordSet.RecordCount = 0) Then
  23.         inAlter = False
  24.     Else
  25.         MsgBox ("INALTER(): Unable to retrieve data.")
  26.         Exit Function
  27.     End If
  28.    
  29.     newRecordSet.Close
  30.     newConnection.Close
  31.     Set newRecordSet = Nothing
  32.     Set newConnection = Nothing
  33. End Function
  34. '*ENDOF*INALTER()**************************************************************