PDA

Click to See Complete Forum and Search --> : VBSQL TYPE MISMATCH ERROR


ganraj
Dec 7th, 1999, 07:50 PM
Hello!,


I am getting type mismatch error when I call vbsql functions.

Private Sub Command1_Click()
Dim result As Long
'Get a Login record and set login attributes.
Login = SqlLogin()
LoginID = Text2.Text
passwd = Text3.Text

result = SqlSetLUser(Login, LoginID)
result = SqlSetLPwd(Login, passwd)
result = SqlSetLApp(Login, example)

'Get a connection for communicating with SQL Server.
Server = Text1.Text
Sqlconn = SqlOpen(Login, Server)

End Sub


At the SqlSetLUser call the error is returned. The return is 'long' defined in the vbsql.bas


Can anybody help?


------------------
ganraj.

[This message has been edited by ganraj (edited 12-08-1999).]

MartinLiss
Dec 7th, 1999, 10:17 PM
You are getting the error not because of what it returns, but what you are sending it. As far as I can see, you haven't Dim'ed Login so it becomes a Variant, and I assume that SqlSetLUser is expecting a string.

------------------
Marty