Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access --> SQL- report problem

Status
Not open for further replies.

varean

Technical User
Apr 9, 2001
17
US
We moved a database from ms access 2003 to SQL server 2000. We kept all queries in ms access. Can someone please tell me what is wrong with this code, I'm getting the error " problems obtaining data" when it tries to import the data into excel.
it's supposed to import data to an excel spreadsheet.

Private Sub cmdcaseload_Click()
On Error Resume Next
DoCmd.DeleteObject acTable, "FirstTimeClients"
DoCmd.OpenQuery "clients_first_time_Table"
DoCmd.DeleteObject acTable, "Clients"
DoCmd.DeleteObject acTable, "caseload"
DoCmd.DeleteObject acTable, "ftc"
If IsNull(d3) Then
DoCmd.OpenQuery "ftc_Table"
DoCmd.OpenQuery "clients_Table"
DoCmd.OpenQuery "outcome_caseload_table"
Else
DoCmd.OpenQuery "ftc_Table_after"
DoCmd.OpenQuery "clients_Table_after"
DoCmd.OpenQuery "outcome_caseload_table_after"
End If
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "ftc", "ftc", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "firsttimeclients", "firsttimeclients", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "clients", "clients", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "caseload", "caseload", False
Call Shell("EXCEL.EXE c:\work\satp\caseload.xls", 1)
 
Are you sure that is the right forum to ask?
I didn't see any SQL Server related command here.
Maybe you should ask in Access forum?

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
Microsoft MVP VFP
 
Not sure I understand...if you moved to SQL Server, than there are no tables in access for your queries to run against.
You will have to create link tables to your SQL Server so that you can run the queries against them.
 
Yes, are you using linked tables or is this an ADP? In either case, you need to ask in either the Access or ADP forum.
 
Sorry Guys, I will post it in the correct forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top