Howdy

I am trying to backup a sqlserver 2005 database via a form in microsoft access. The form allows a user to put in a file location and backup the sql server 2005 database via an ODBC connection.

I have tried it as a direct sql call and as a storedprocedure but keep getting ODBC call errors.
my code is

Dim sqldb as DAO.Database
Dim strSQL as string
Dim strConnect as string

strConnect = "ODBC;DSN=asdandb;Description=asdandb;APP=Microsof t® Access;WSID=PAULSINCLAIR;DATABASE=ASDANDAT;Trusted _Connection=Yes"

Set sqldb = DBEngine.OpenDatabase("asdandb",dbDriverComplete,T rue,strConnect)

strSQL = "BACKUP DATABASE [FINANCETEMPLATE] TO DISK = 'C:\test.bak' WITH COPY_ONLY,NOFORMAT, NOINIT, NAME = N'FINANCETEMPLATE_backup_manual', SKIP, REWIND, NOUNLOAD, STATS = 10"

sqldb.Execute strsql , dbSQLPassThrough


'C:\test.bak' will be a parameter passed by the user via the form.

with dbsqlpassthrough i get error 3146 ODBC--call failed.

without dbsqlpassthrough i get error 3065 cannot execute a select statement


I'm not sure what Im missing here - help as always greatly appreciated!!!