D
dougloj
I have a disconnected Access 2003 project (adp)that I use to access an
SQL Server 2000 database. I open and close the connection from the
project to the database to get and store data as needed in the project
with no problem.
Can anyone tell me how to print a report within the project VBA code
using data from the database?
I've tried the folling code :
Set conn = New ADODB.connection
conn.ConnectionString = <connection string info ...>
conn.Open
conn.CursorLocation = adUseClient
DoCmd.OpenReport stDocName, acNormal
conn.Close
When I run this code, I get an error which says:
"Access was not able to perform this operation because the project is
not connected to a SQL Server database."
Any ideas would be welcomed!
Thanks for the bandwidth.
- Doug
SQL Server 2000 database. I open and close the connection from the
project to the database to get and store data as needed in the project
with no problem.
Can anyone tell me how to print a report within the project VBA code
using data from the database?
I've tried the folling code :
Set conn = New ADODB.connection
conn.ConnectionString = <connection string info ...>
conn.Open
conn.CursorLocation = adUseClient
DoCmd.OpenReport stDocName, acNormal
conn.Close
When I run this code, I get an error which says:
"Access was not able to perform this operation because the project is
not connected to a SQL Server database."
Any ideas would be welcomed!
Thanks for the bandwidth.
- Doug