views:

276

answers:

3

Set up an Access Project to be opened via Citrix. However, there is some VBA code that prevents it from working:

Dim rs As ADODB.Recordset
Set rs = CurrentProject.Connection.Execute("Query")

The .Connection bit is highlighted. This works when it is not opened via Citrix though (i.e. just on users desktop).

A: 

I don't have a lot of experience with ADO but I'm thinking there's a references problem of some sort. Or that you are referencing a newer version of ADO on your system than is avaialble on the Citrix box. Run the following code and post back the results.

Sub ViewReferenceDetails()

Dim ref As Reference

    For Each ref In Access.References
        Debug.Print ref.Name & " - " & ref.Major & "." & ref.Minor & " - " & ref.FullPath
    Next ref

End Sub

Also when you state Access project do you mean an ADP against SQL Server or an MDB/ACCDB against an Access data file?

Tony Toews
It is an ADP (Access 2000 format) with SQL Server 2005 backend
Sam
What were the results of running the above code?
Tony Toews
References are fine... problem does not seem to occur now ... I think the Citrix admins may have updated MDAC 2.8 to the latest service packs.. or related to the fact Citrix pointed to the file directly, rather than as a parameter to MSACCESS.exe
Sam
A: 

Your code looks wrong to me. Should the rs Object not be a Recordset?

i.e.

Dim rs As ADODB.Recordset
'Instead of
Dim rs As ADODB.Connection

The code should not run at all - you should receive a Type Mismatch error.

Mark3308
That was a typo... it is ADODB.Recordset in the code
Sam
+1  A: 

Problem was due to the Citrix server not having the latest Jet Service Pack for Access.

Sam