I have a problem when i distributed my application. When i installed it in my computer (where VB6 is installed) it worked normally, but in others y have the message "error 13, type missmatch". Is this a DLL problem or what ?.
Thank for some help !!
Printable View
I have a problem when i distributed my application. When i installed it in my computer (where VB6 is installed) it worked normally, but in others y have the message "error 13, type missmatch". Is this a DLL problem or what ?.
Thank for some help !!
Can you give us more detail ?
For example, when does this happen, what does your application do ... etc ?
The message appears when i use a function to validate a user and password readind an Access Database, after accept this data like that:
=> Private Sub cmdOK_Click()
On Error GoTo cmdOKerr
If valido(txtUserName, txtPassword) Then
LoginSucceeded = True
Unload Me
FrmBusca.Show
else
.............
and the function is:
=> Public Function valido(user As String, pass As String)
If user = "" Or pass = "" Then
valido = False
Exit Function
End If
strSQL = "SELECT * FROM USUARIOS WHERE usuario = '" + user + "'"
Set rs = cn.Execute(strSQL)
If rs.EOF Then
valido = False
GoTo finval
End If
If rs!contraseƱa <> pass Then
valido = False
GoTo finval
End If
valido = True
nivel = rs!nivel
finval:
rs.Close
Set rs = Nothing
End Function
The error appears in the first procedure (calling function).
How did you install the program on other computers??? Did you just take the .exe file and used this or what?? If so then try using the VB Distrubution Wizard... It will take all the files that the program needs to run except the database...
I had a similar problem when I distrubuted a database interacting program!! The distrubution wizard doesn't include the database automatically. To make it include the database in the .cab file try running the distrubution wizard and then include the database!!
Another thing that could be the problem is because you defined the adress of the database in VB's properties explorer and not as code!!! The database only have this path on your computer and not the users computer... In order to fix this write in the form load prodcedure:
Code:Public DBPath as String
DBPath = App.Path/ & "database path" 'I thing it is this but I'm not quite sure....
Hope this helped or else try to define the problem a little more...
Enjoy....
Replace this line
strSQL = "SELECT * FROM USUARIOS WHERE usuario = '" + user + "'"
by this:
strSQL = "SELECT * FROM USUARIOS WHERE usuario = '" & user & "'"
Also, it could be a problem of version conflicts between ADO versions.
Make sure you deploy the latest mdac version (file mdac_typ.exe)with your applications.
Eventually, download the right MDAC version on www.microsoft.com/data and place it in the right directory (C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\Redist)
Hope this helps,
Luc
Thanks all for your help.
The problem finished. I have an old mdactype version in the current fold, i installed SP4 but it not installed the new version in the right directory. I copied it now.