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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execution of a Pass Through Query Fails on only some PCs.

Status
Not open for further replies.

hughesai

Technical User
Aug 1, 2002
101
GB
I have a SQL Server 2000 stored procedure for sending e-mails which I call from an A97 front end. My problem is that it works on some PCs, but fails on others. It fails in Access - not SQL Server, so I am posting in this forum. The code is as follows:

Dim wsp As Workspace
Dim qdf As QueryDef
Dim cnn As Connection

Set wsp = CreateWorkspace("ODBCDirect", "Admin", "", dbUseODBC)
Set cnn = wsp.OpenConnection(Name:="", Options:=dbDriverNoPrompt, ReadOnly:=True, Connect:=G_CONNECTION)

Set qdf = cnn.CreateQueryDef("qry", "{ call send_Sys_Email(?,?,?,?,?) }")

With qdf
.Parameters(0).Direction = dbParamInput
.Parameters(1).Direction = dbParamInput
.Parameters(2).Direction = dbParamInput
.Parameters(3).Direction = dbParamInput
.Parameters(4).Direction = dbParamInput
.Parameters(0) = stFrom
.Parameters(1) = stTo
.Parameters(2) = stSubject
.Parameters(3) = stBody
.Parameters(4) = stCC
.Execute
.Close
End With

The error I get is "ODBC--call failed". It occurs at the .Execute line.

Why might this work on some and not on others? The builds should be similar - all are Win 2k - some have A97 runtime, some full A97, some full A2K, some two or more, but there is no pattern between the version(s) of Access installed and the PCs on which the code fails. I know the connection strings are correct, and permissions on SQL server are not the problem. I also have code opening recordsets on all the PCs and sucessfully returning records - none of these connections fail. Are there extra optional components which need to be installed for this sort of connection to work?



 
Check the status of each machine's MDAC update.

I thinks it's at 2.8 at the moment but its been lots of months since I was worried by that issue.

Since we found that it was a problem it has become a SysAdmin responsibility to make sure all machines are up-to-date. So I don't have to worry any more.


You can get the latest MDAC update file from the MicroSoft web site.



'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top