Results 1 to 3 of 3

Thread: VB3 to SQL Server 6.5 with VBSQL problem

  1. #1
    Sixto Saez Guest

    VB3 to SQL Server 6.5 with VBSQL problem

    I`m having a problem trying to upgrade a VB 3 app using VBSQL (16 bit) from SQL Server 6.0 to SQL Server 6.5... Is there a new api declaration for VBSQL that goes with SQL Server 6.5???
    Has anyone else had probelms with this upgrade?? Please email to start a dialog...
    thanks,
    Sixto

  2. #2
    Join Date
    Sep 2017
    Posts
    1
    Quote Originally Posted by Sixto Saez View Post
    I`m having a problem trying to upgrade a VB 3 app using VBSQL (16 bit) from SQL Server 6.0 to SQL Server 6.5... Is there a new api declaration for VBSQL that goes with SQL Server 6.5???
    Has anyone else had probelms with this upgrade?? Please email to start a dialog...
    thanks,
    Sixto
    I know it's a bit late and you've moved on but this may help other people who are similarly stuck in the past.

    If you look in the VB3 Help under the OPENDATABASE function you will see that you can connect to a SQL server database using ODBC.

    You can even connect to a 64-bit SQL Server 2016 database using this method along with any other ODBC compliant database.
    While the other advice to move the program to an updated language is the obvious answer - it is possible to work with VB3 and SQL server.

    You can't use ADO with VB3 however but you are stuck with DAO.

    I am in a similar position with a number of customers using applications written in VB3 and using ms-access V2 which I'd like to migrate to SQL server.
    I'm choosing to update the programming language mostly because 16-bit apps won't run on 64-bit Windows.
    However the VB3 apps DO run quite OK on windows 7/8/87/1/10 32-bit versions with no tricky workarounds required.

    If the apps are not that large it shouldn't be too hard to migrate them to VB6 and use SQL server but I have VB3 apps with around 1,000,000 lines of code which pushes them to their absolute memory limit but they still work. tried to convert these to VB6 using my own VB6 conversion wizard on servral occassion but given up because the number of errors that you need to fix before the program will even run at all is so large.
    Unfortunately you only find out about these errors one at a time using run, identify next error, fix error, run, identify next error, fix error, run and so on.

    I have a number of customers running these VB3 apps on 64-bit Windows (even in 2017) by using a VirtualBox or VMWare virtual machine running a 32-bit version of the same Version of Windows as the host machine.
    In some cases they've even been able to use the same product key for both the virtual and physical machine - which may not be totally kosher but since there is only one computer and one user involved I doubt that Microsoft would be too concerned.

    anyway - to get access to a SQL server database from VB3 ...

    Create an ODBC entry called MyDatabase which points to a SQL server database then run this code (or similar) in your VB3 application.

    You can see that you CAN access a SQL server database from VB3 - not only that but the database I accessed was running in a 64-bit SQL server instance on a 64-bit windows 10 PC

    Sub Main ()

    Dim dBase As Database, rsWork As Dynaset, Cnt As Integer

    Set dBase = OpenDatabase("MyDatabase", False, False, "ODBC; DSN=MyDatabase;UID=username; PWD=password")
    Set rsWork = dBase.CreateDynaset("Select * from customers")
    rsWork.MoveFirst
    For Cnt = 1 To 10
    MsgBox CStr(Cnt) & ":" & rsWork("Name")
    rsWork.MoveNext
    Next Cnt
    rsWork.Close
    dBase.Close
    End
    End Sub

  3. #3
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932

Posting Permissions

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