VB3 app and SQLServer 2000


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: VB3 app and SQLServer 2000

  1. #1
    franka Guest

    VB3 app and SQLServer 2000


    Is there any way to get a VB3 app to access a SQLServer 2000 database??

  2. #2
    Paul Clement Guest

    Re: VB3 app and SQLServer 2000

    On 28 Sep 2001 11:34:04 -0700, "franka" <fea@robinson-consulting.com> wrote:


    Is there any way to get a VB3 app to access a SQLServer 2000 database??

    Yes, but not directly. You would need to create a 32-bit ActiveX EXE that connects to your SQL
    database and marshals the data back and forth from your VB 3.0 application.


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Sep 2017
    Posts
    1
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center