Need help with the following code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
Back
Top