Results 1 to 6 of 6

Thread: string error

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    Cordoba, Argentina
    Posts
    15

    Unhappy string error

    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 !!

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Can you give us more detail ?
    For example, when does this happen, what does your application do ... etc ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    Cordoba, Argentina
    Posts
    15

    Post more details

    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).

  4. #4
    Lively Member
    Join Date
    Nov 2001
    Location
    Behind you...
    Posts
    88
    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....
    Enjoy...
    ----
    If something is hard to do then it aint worth doing!!

  5. #5
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Belgium/Antwerp
    Posts
    275
    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

  6. #6

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    Cordoba, Argentina
    Posts
    15

    Wink thanks

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width