G
Guest
hello!
I'm trying to run the following query, but I get an error message:
The code:
Dim oDataBase As DAO.Database
Set oDataBase = OpenDatabase("C:\Program Files\Microsoft Visual
Studio\VB98\NWIND.MDB")
sql = sql & "SELECT Customers.Customers_ID, Customers.Company_ID,
Customers.C_Email, Customers.C_FName, Customers.C_LName "
sql = sql & "FROM Customers "
sql = sql & "WHERE (((Customers.Company_ID)=" & num & ")) "
sql = sql & "ORDER BY Customers.C_LName;"
Dim qdf As DAO.QueryDef
Set qdf = oDataBase.CreateQueryDef("My sql", sql)
The error message:
object variable or with block variable not set
How can I fix the problem?
thanks,
Yonina.
I'm trying to run the following query, but I get an error message:
The code:
Dim oDataBase As DAO.Database
Set oDataBase = OpenDatabase("C:\Program Files\Microsoft Visual
Studio\VB98\NWIND.MDB")
sql = sql & "SELECT Customers.Customers_ID, Customers.Company_ID,
Customers.C_Email, Customers.C_FName, Customers.C_LName "
sql = sql & "FROM Customers "
sql = sql & "WHERE (((Customers.Company_ID)=" & num & ")) "
sql = sql & "ORDER BY Customers.C_LName;"
Dim qdf As DAO.QueryDef
Set qdf = oDataBase.CreateQueryDef("My sql", sql)
The error message:
object variable or with block variable not set
How can I fix the problem?
thanks,
Yonina.