am trying to delete records in the SQL Server from MS Access forms. I got error 3065 cannot execute a select qury, when trying the below code.
Dim qdfPassThrough As DAO.QueryDef
Dim rstPassThrough As DAO.Recordset
Dim strConnect As String
Dim dbCurrent As DAO.Database
Set qdfPassThrough = CurrentDb.Creat eQueryDef("")
strConnect = "Driver=SQL SERVER;SERVER = NTSQLSERVER;Dat abase=TEST;UID= mlp;password='' ;"
qdfPassThrough. Connect = "ODBC;" & strConnect
qdfPassThrough. SQL = "DELETE FROM tempDefTable"
qdfPassThrough. Execute
Please help me
Thanks
Jambai
Dim qdfPassThrough As DAO.QueryDef
Dim rstPassThrough As DAO.Recordset
Dim strConnect As String
Dim dbCurrent As DAO.Database
Set qdfPassThrough = CurrentDb.Creat eQueryDef("")
strConnect = "Driver=SQL SERVER;SERVER = NTSQLSERVER;Dat abase=TEST;UID= mlp;password='' ;"
qdfPassThrough. Connect = "ODBC;" & strConnect
qdfPassThrough. SQL = "DELETE FROM tempDefTable"
qdfPassThrough. Execute
Please help me
Thanks
Jambai
Comment