Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
ASP connection to database
Old 02-07-2006, 04:59 AM ASP connection to database
tcb
Experienced Talker

Posts: 34
Trades: 0
Hello,

I am trying to connect to a database and I am using the following piece of code:

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "dsn=mydatabase;uid=user;pwd=password;"

But, as the database is on another computer, I would like to connect to it using the IP address of the computer instead of a dsn connection. Can anyone help me with that?

Thanks,
tcb.
tcb is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-07-2006, 05:40 AM Re: ASP connection to database
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
What sort of database is it? (SQL Server, Access?)
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 02-07-2006, 06:20 AM Re: ASP connection to database
tcb
Experienced Talker

Posts: 34
Trades: 0
Hi,

It is an oracle database.
tcb is offline
Reply With Quote
View Public Profile
 
Old 02-07-2006, 10:22 AM Re: ASP connection to database
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
objConn.Open "Provider=OraOLEDB.Oracle;Data Source=OracleDBase;User Id=user;Password=password;"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-07-2006, 11:52 AM Re: ASP connection to database
tcb
Experienced Talker

Posts: 34
Trades: 0
Hi Chris,

I would like to connect to a remote database. So I would like to use a connection that uses the IP address of the computer containing the database. Is that possible?

tcb.
tcb is offline
Reply With Quote
View Public Profile
 
Old 02-07-2006, 01:21 PM Re: ASP connection to database
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
I'm not sure if that's possible in the connection string... I would of thought you would have to set that up in the DSN itself, or somewhere in the Oracle client setup (we used to use TNSNAMES.ORA but I think it depends on your Oracle version and the way you connect)
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 02-07-2006, 03:30 PM Re: ASP connection to database
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Aha! Just noticed a crucial bit missing
Code:
objConn.Open "Provider=OraOLEDB.Oracle;Data Source=OracleDBase;User Id=user;Password=password;Database=dbname;"
datasource would be the server name or IP and Database is the name of the database on the server.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-08-2006, 04:07 AM Re: ASP connection to database
tcb
Experienced Talker

Posts: 34
Trades: 0
Hello Chris,

I tried what you told me, but I got the following message:

"The Provider could not be found."

Can you tell me what does it mean?

Thanks,
tcb.
tcb is offline
Reply With Quote
View Public Profile
 
Old 02-08-2006, 08:51 PM Re: ASP connection to database
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The Oracle OLE drivers are not installed on the server.
Try the ODBC ones at
http://www.carlprothman.net/Default....eFromMicrosoft
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-09-2006, 09:27 AM Re: ASP connection to database
tcb
Experienced Talker

Posts: 34
Trades: 0
Hello Chris,

So I am gonna ask the administrator of the server the to install the OLE drivers, since I need to connect to the database using anything but the ODBC drivers. Thank you very much for your help.

tcb.
tcb is offline
Reply With Quote
View Public Profile
 
Old 02-09-2006, 09:55 AM Re: ASP connection to database
tcb
Experienced Talker

Posts: 34
Trades: 0
Hello again Chris,

About the code that you told me:

objConn.Open "Provider=OraOLEDB.Oracle;Data Source=OracleDBase;User Id=user;Password=password;Database=dbname;"

Is it for ASP.NET or it's also for ASP files?

tcb
tcb is offline
Reply With Quote
View Public Profile
 
Old 02-10-2006, 05:36 AM Re: ASP connection to database
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the connection string should work for either
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to ASP connection to database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54839 seconds with 12 queries