Need help with the following code

J

Jack

Hi,
I got the following code which is giving error in the strTSQL statement. I
appreciate any help. Thanks
Public Sub ExecutePassThrough1(strParam As String)
Dim strTSQL As String
Dim strQueryName As String

strQueryName = "Query1"

strTSQL = "EXEC sp_gettitles " ' & strParam & "'" -- problem with
this part
Call BuildPassThrough(strQueryName, strTSQL)

DoCmd.OpenQuery strQueryName
End Sub
 
O

OldPro

Hi,
I got the following code which is giving error in the strTSQL statement. I
appreciate any help. Thanks
Public Sub ExecutePassThrough1(strParam As String)
Dim strTSQL As String
Dim strQueryName As String

strQueryName = "Query1"

strTSQL = "EXEC sp_gettitles " ' & strParam & "'" -- problem with
this part
Call BuildPassThrough(strQueryName, strTSQL)

DoCmd.OpenQuery strQueryName
End Sub

First single quote goes in front of double quote.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top