|
-
Mar 7th, 2001, 09:09 PM
#1
Thread Starter
Hyperactive Member
Dear all,
How does one formulate the connection string to connect to an SQL Server database. Can I use the IP address of the machine rather than the name of the machine. Also I am using SQLOLEDB to connect to the database. Besdies is it posible to make the settings for a remote SQL Server machine i.e. can i create databases and make database settings in a remote SQL Server using ftp or something like that. Thanks in advance.
-
Mar 8th, 2001, 10:25 AM
#2
Lively Member
Here's what you need to do..
Code:
Option Explicit
Dim objConnection, objRecordset, strSQL
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.ConnectionString = "Provider=SQLOLEDB; Data Source=SERVER; Initial Catalog=DATABASE_ON_SERVER; User ID=USER; Password=PASSWORD"
objConnection.Open
Set objRecordset = Server.CreateObject("ADODB.Recordset")
strSQL = "SQL code goes here"
objRecordset.Open strSQL, objConnection
Rich
-
Mar 8th, 2001, 01:55 PM
#3
yes, IP addresses work; they go into the Data Source parameter.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|