Re: Passthrough Query and manipulating .Connect property *Help!!*



Check this:

With qdf
.Connect = strCon
.SQL = strSQL
.Execute 'You're missing the execute part.
End With

Besides that, make sure the optional parameter is null when you think
it is:

msgbox "strCon value: [" & strCon & "] - NULL: " & iif
(isnull(strCon),"YES","NO")

Regards

On Jul 26, 8:26 am, KayC <kay_c...@xxxxxxxxxxx> wrote:
Hi
I use Access2002
I have created a simple form with 3 parameter UserID, Password &
Database
When a user enters values into these text boxes a passthrough query to
a Sybase database is envoked with the connection string set to the
form parameters
My problem is that when an invalid username, password or database
string is entered the passthrough query still works even though
looking at the connect property this has changed to the form input

Any ideas?? - this is driving me mad!! Here is the function I wrote:

Call create_qry("qpt_IRRollIRCurve", "exec IRRollIRCurve", strCon)

Function create_qry(strQryName As String, strSQL As String, Optional
strCon As String)

Dim db As DAO.Database
Dim qdf As DAO.QueryDef

Set db = CurrentDb
Set qdf = db.CreateQueryDef(strQryName)

If IsNull(strCon) = False Then
With qdf
.Connect = strCon
.SQL = strSQL
End With
Else
End If

Set qdf = Nothing
Set db = Nothing

Regards Kay


.



Relevant Pages