Hiya,
I'm getting access data through excel vba. Everything works fine. I'm also using ADOX for DLL & Security to do stuff in access without opening the access databases in question.
Now my end user is saying they won't have access installed. Can I still get data from the access databases if I used ODBC? If so
(a) what references do I need on the project, are there any DLLs that will need putting on the client's machine?
(b) how do I change my code (below) to work with ODBC?
(c) how do I make the new DB an ODBC source?
Can anyone please help me out of a sticky situation?
I'm getting access data through excel vba. Everything works fine. I'm also using ADOX for DLL & Security to do stuff in access without opening the access databases in question.
Now my end user is saying they won't have access installed. Can I still get data from the access databases if I used ODBC? If so
(a) what references do I need on the project, are there any DLLs that will need putting on the client's machine?
(b) how do I change my code (below) to work with ODBC?
(c) how do I make the new DB an ODBC source?
Can anyone please help me out of a sticky situation?
Code:
Private Sub FetchRecords(filename As String, specCond As String, ContractID As String)
'Get data from access db and' transfer to the live worksheet
Dim con As ADODB.Connection
Dim sSQL As String
Dim rs As ADODB.Recordset
Dim col As Long, rw As Long
Dim fn
Dim strAccesDB
Dim rectype
Set con = New ADODB.Connection
'Specify which SQL is used to get records from accessdb
If specCond = "" Then
sSQL = "SELECT * FROM Sender WHERE ClientID = " & ContractID
Else
sSQL = "SELECT * FROM Sender WHERE ClientID = " & ContractID _
& " AND Client_Ref = " & specCond
End If
'put the filename arg into the connection string
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& filename
'Open the new connection
con.Open
Set rs = con.Execute(sSQL)
'etc etc