Compile error

R

RipperT

I have a very simple database for which I set up a
switchboard with an item to open a form in add mode.
Every time I try to run the switchboard, I get the
message: "Compile error: error in loading DLL" and the
debugger opens up with the word "connection" highlighted
in the following section of code.

' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set con = Application.CurrentProject.Connection
stSql = "SELECT * FROM [Switchboard Items]"
stSql = stSql & " WHERE [ItemNumber] > 0 AND
[SwitchboardID]=" & Me![SwitchboardID]
stSql = stSql & " ORDER BY [ItemNumber];"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1 ' 1 = adOpenKeyset

Any ideas? Thankyou!

Rip
 
G

Guest

Access 2002.
How is con declared? - I don't know what that means.
Rip


-----Original Message-----
Access 2000?
Access 2003?

How is con declared?
-----Original Message-----
I have a very simple database for which I set up a
switchboard with an item to open a form in add mode.
Every time I try to run the switchboard, I get the
message: "Compile error: error in loading DLL" and the
debugger opens up with the word "connection" highlighted
in the following section of code.

' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set con = Application.CurrentProject.Connection
stSql = "SELECT * FROM [Switchboard Items]"
stSql = stSql & " WHERE [ItemNumber] > 0 AND
[SwitchboardID]=" & Me![SwitchboardID]
stSql = stSql & " ORDER BY [ItemNumber];"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1 ' 1 = adOpenKeyset

Any ideas? Thankyou!

Rip
.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top