answersLogoWhite

0


Best Answer

OLE DB connections not only offer greater performance than ODBC (DSN) , but also allow some additional functions and have the benefit that you do not need to wait for your Web Hosting provider to set up a DSN on your server.

First create a new text file, by default windows will name it New Text Document.txt, rename the file NewConnection.udl, or whatever you wish, the important thing is to change the file extension to .udl (Universal Data Link). Windows will give you a warning message about renaming file extensions, click Yes to proceed.

Double click the newly created .udl file, this will open the Data Link Properties box shown below:

Select Microsoft OLE DB Provider for SQL Server from the list shown and click the Next>> button.

To connect to a SQL Server database on your local PC, select or type in the server name in the text box number 1. Next click the relevant radio button and select whether you wish to use Windows NT integrated security or a specific user name and password. Finally select the database on the SQL Server to which you wish to connect.

Click the Test Connection button to confirm that everything is working correctly and click OK. Now right click the .udl file and select Open with Notepad.

If you selected Windows NT Integrated security you should see something like this:

[oledb]

; Everything after this line is an OLE DB initstring

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=YourDB;_

Data Source=YOUR_LOCAL_SERVER_NAME

If you selected Use a specific user name and password, you will see something like this:

[oledb]

; Everything after this line is an OLE DB initstring

Provider=SQLOLEDB.1;Password=YourPassword;Persist Security Info=True;User ID=YourUserID;_

Initial Catalog=YourDB;Data Source=YOUR_LOCAL_SERVER_NAME

You can now copy and paste the connection string wherever it's required, for example:

<%

Set commInsert = Server.CreateObject("ADODB.Connection")

commInsert.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;_

PersistSecurity Info=False;Initial Catalog=_

YourDB;_Data Source=YOUR_LOCAL_SERVER_NAME

strInsertCommand = "INSERT INTO tableName(TextField, NumericField)_

VALUES('ABCDE', 12345);"

commInsert.Execute(strInsertCommand) ' Execute the insert command

commInsert.Close()

Set commInsert = Nothing

%>

connecting to the remote database

Connecting to a remote SQL Server database is almost identical to connecting to a local database.

Create a .udl (Universal Data Link) file as in the first section, select Microsoft OLE DB Provider for SQL Server from the list and click Next, as before.

The details required to make the connection should be given to you by the host provider or your server administrator. Type in the server name in the text box, number 1, this may be an IP address as shown or a domain address like http//YourServer.com. Next enter the user name and password supplied by the host provider or administrator. Finally select your database on the SQL Server to which you wish to connect.

Open the .udl file with notepad, the connection string will appear similar to this:

[oledb]

; Everything after this line is an OLE DB initstring

Provider=SQLOLEDB.1;Password=YourPassword;Persist Security Info=True;User ID=YourUserID;_

Initial Catalog=YourDB;Data Source=YOUR_REMOTE_SERVER_NAME

User Avatar

Wiki User

16y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to set up an OLE DB connection?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you provide connection with database in asp pages?

This will hook you up to an Access DB:


How do you set up a wireless connection on a PS3?

you need to set up your wireless router with your internet connection to your computer, and then search for an access point on the ps3 under internet setting, under set up connection, then just follow the instructions from there


How do you run a MySQL query from PHP file?

Here is a simple script that you can do to run a MySQL query after you have set a database up. &lt;?php // Database Settings $db['hostname'] = "localhost"; $db['username'] = "&lt;db username&gt;"; $db['password'] = "&lt;db password&gt;"; $db['database'] = "&lt;db name&gt;"; // Connect to MySQL $connect = mysql_connect($db['hostname'], $db['username'], $db['password']); // Select Database mysql_select_db($db['database'], $connect); // Do MySQL Query mysql_query("INSERT INTO table_name SET field_name = '1234567890'"); // Close MySQL mysql_close($connect); ?&gt; Obviously you will need to use your own MySQL settings and database details, but this gives you a general overview of how you can do it.


how do you protect your wireless net connection from other net users?

You can set up a password for the connection


How do I set up a wireless internet connection in my home?

In order to set up a home wireless internet connection, you must have broadband service and a wireless router. After connecting your router, use your computer and the router's instructions to set up your network.


How do you set up wireless connection in Nokia 5230?

no you cant


What do you do before you set up the Internet connection?

buy PSN


Do you need an internet connection for the initial set up of PS3?

No


Set up a Business Internet Connection?

form_title=Set up a Business Internet Connection form_header=Connect your business employees to the outside world. How much bandwith do you need?=_ How many computers will need to be hooked up?=_ Would you like to set up video conferencing?= () Yes () No


How do you set up a dial up connection on a mac?

For a dial-up connection on a Mac you would use the internal modem or an external modem connected via USB.


What is Connectionless and Connection Oriented?

Connection-Oriented means that when devices communicate, they perform handshaking to set up an end-to-end connection. Connection-Oriented systems can only work in bi-directional communications environments. Connection-less means that no effort is made to set up a dedicated end-to-end connection. Walkie-talkies, or Citizens Band radios are a good examples of connection-less communication.


How do you restrict downloading from wireless connection?

Set up wireless security politics.