ASP 101 - Active Server Pages 101 - Web05
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Getting Scripts to Run on a Schedule
The Top 10 ASP Links @ Microsoft.com
What is Adovbs.inc and Why Do I Need It?

QUICK TIP:
Hiding and restoring Visual InterDev's Workspace pane
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


Don't use ODBC for your database connections

When ASP was introduced, everyone used ODBC for their data connections because it was the only real choice and that's how all the samples showed it being done. Well that was then and this is now! OLE DB is faster, more stable, just as easy to use, and most importantly works with almost all your previously written code!

To use OLE DB, all you need to do is change the connection string that you use to connect to your database.

In ODBC it would look something like this:

"DSN=dsn-name;"
or
"DBQ=C:\data\database.mdb; DRIVER={Microsoft Access Driver (*.mdb)}"

To switch to OLE DB all you need to do is change it to something like this:

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\data\database.mdb;"
or
"Provider=SQLOLEDB; Data Source=sql_server; Initial Catalog=sql_database; " _
   & "User Id=username; Password=password;"

Note: You'll also need to put square quotes around your table names if you're using OLE DB with Access.


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers