B
Barry
I have a SQL 2000 database with many tables and views. I am writing a front
end in Access 2003 for an adp project. In Access, I want to create code
modules for functions that query and update SQL tables. Following the help
files, I have created (for example) the following code:
Sub Find_Prod_Order()
Dim CurConn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim SQLStmt As String
SQLStmt = "SELECT COUNT(DISTINCT prod_order_number) FROM prod_order_hdr"
CurConn.Open "DSN=SQL_Server;uid=dbuser;pwd=123456;database=production"
Set rst = CurrCon.OpenRecordset(SQLStmt)
End Sub
This code fails on the Set rst = ... line with "Run-time error: 424 Object
required" message. I've tested the sql code in query analyzer and it works
fine. I'd appreciate it id someone could help me correct my code. TIA,
Barry
end in Access 2003 for an adp project. In Access, I want to create code
modules for functions that query and update SQL tables. Following the help
files, I have created (for example) the following code:
Sub Find_Prod_Order()
Dim CurConn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim SQLStmt As String
SQLStmt = "SELECT COUNT(DISTINCT prod_order_number) FROM prod_order_hdr"
CurConn.Open "DSN=SQL_Server;uid=dbuser;pwd=123456;database=production"
Set rst = CurrCon.OpenRecordset(SQLStmt)
End Sub
This code fails on the Set rst = ... line with "Run-time error: 424 Object
required" message. I've tested the sql code in query analyzer and it works
fine. I'd appreciate it id someone could help me correct my code. TIA,
Barry