How to connect to SQL Server 6.5 using VB 5.0 
Author Message
 How to connect to SQL Server 6.5 using VB 5.0

Can anybody provide me just a brief code snippet on how to connect to MS SQL
Server 6.5 using VB 5.0 Enterprise?

Although I am not a newbie in Visual Basic, I am a newbie in Client/Server
programming. Just as we would use the OpenDatabase method of the workspace
object to 'link' to the database we want, what would be the equivalent if
one were to use RDO to connect to a remote MS SQL Server 6.5?

Can somebody give me a small code snippet that shows the works of connecting
and opening a database on a remote server, and then closing the connection?

Thanks.

Jonathan O.



Thu, 30 Nov 2000 03:00:00 GMT  
 How to connect to SQL Server 6.5 using VB 5.0

This code use RDO to connect to Sql Server DataBase
without ODBC DSN, and in this case close the connection
immediately.

   Dim cn As New rdoConnection
   Dim ServerName As String
   Dim DSName As String
   Dim UID As String
   Dim PWD As String
   Dim Driver As String
   Dim DataBase As String

   DSName = " "
   UID = "clinnet"
   Driver = "{SQL Server}"
   DataBase = "EMPI"
   PWD = "oentry"

   cn.Connect = "UID=" & UID & ";pwd=" & PWD & ";server=" & ServerName &
";driver=" & Driver & ";database=" & DataBase & ";DSN='';"
   cn.CursorDriver = rdUseOdbc
   cn.EstablishConnection rdDriverNoPrompt

   cn.Close    ' Close the connection.

=========

Quote:

>Can anybody provide me just a brief code snippet on how to connect to MS
SQL
>Server 6.5 using VB 5.0 Enterprise?

>Although I am not a newbie in Visual Basic, I am a newbie in Client/Server
>programming. Just as we would use the OpenDatabase method of the workspace
>object to 'link' to the database we want, what would be the equivalent if
>one were to use RDO to connect to a remote MS SQL Server 6.5?

>Can somebody give me a small code snippet that shows the works of
connecting
>and opening a database on a remote server, and then closing the connection?

>Thanks.

>Jonathan O.




Thu, 30 Nov 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. connecting to MS SQL Server 6.5 using VB5

2. VB 5.0 and SQL Server 6.5 Contract

3. LONDON - VB 5.0/Sql-Server 6.5/ NT 4 - Developers - Derivatives Trading Systems

4. LONDON - VB 5.0/Sql-Server 6.5/ NT 4.0 - Developers - Derivatives Trading Systems

5. VB 5.0, SQL Server 6.5

6. Help SQL SERVER 6.5/VB 5.0

7. S10008 Error From SQL Server 6.5 Running VB 5.0 Stored Procedures

8. Writing data from VB 5.0 to a SQL Server 6.5 database

9. VB 5.0 and SQL Server 6.5

10. VB 5.0 & Stored Procedure (SQL Server 6.5)

11. DNS-Less Trusted Connection Discrepancy - Sql Server 6.5 -- VB 5.0

12. S10008 Error From SQL Server 6.5 Running VB 5.0 Stored Procedures

 

 
Powered by phpBB® Forum Software