I am having trouble connecting to my odbc foxpro database to create cursors or views. here is (basically) the code:
public cn as database
public strBOM as string
strBOM = "create view bomsql as SELECT * from inventor;"
set cn = opendatabase("db", dbDriverNoPrompt, False, "ODBC;DSN=db;"
on error resume next
cn.execute strBOM
If Err.Number <> 0 Then 'ERROR CHECKING
Msg = "Error # " & str(Err.Number) & " was generated by " _
& Err.Source & Chr(13) & Err.Description
response = MsgBox(Msg, vbOKOnly, "Error BOM Table", , Err.Description)
If response = vbOK Then
End
End If
Exit Sub
End If
On Error Resume Next
..I have a watch on msg that returns..
"Error # 3290 was generated by DAO.Database
Syntax error in CREATE TABLE statement."
..when I paste the query into vfp it runs fine, but for some reason it wont work from excel. Any ideas?
public cn as database
public strBOM as string
strBOM = "create view bomsql as SELECT * from inventor;"
set cn = opendatabase("db", dbDriverNoPrompt, False, "ODBC;DSN=db;"
on error resume next
cn.execute strBOM
If Err.Number <> 0 Then 'ERROR CHECKING
Msg = "Error # " & str(Err.Number) & " was generated by " _
& Err.Source & Chr(13) & Err.Description
response = MsgBox(Msg, vbOKOnly, "Error BOM Table", , Err.Description)
If response = vbOK Then
End
End If
Exit Sub
End If
On Error Resume Next
..I have a watch on msg that returns..
"Error # 3290 was generated by DAO.Database
Syntax error in CREATE TABLE statement."
..when I paste the query into vfp it runs fine, but for some reason it wont work from excel. Any ideas?