Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Creating connection to database

Author  Topic 

andy_is
Starting Member

1 Post

Posted - 2008-07-18 : 10:03:17
Hi,

I am trying to create some code in Visual Basic that creates a connection to a to a sql server db, opens the database and executes queries.....I can do this for Oracle databases but not sure how to do this for SQL Server DBs. The code to create connection to oracle is as follows

'Create Connection
Set objSession = CreateObject("OracleInProcServer.XOraSession")

'Opens Database
Set objdatabase = objSession.OpenDatabase(SID, UserName & "/" & Password, 0&)

'Executes Query
Set QueryResults = objdatabase.DBCreateDynaset(sqlQuery, 0&)

Can anyone help?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-18 : 10:15:43
www.connectionstrings.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -