Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection Problem

Status
Not open for further replies.

ssmenon

Programmer
Sep 6, 2002
8
IN
Hello all

I am useing OLEDB to connect to my sql database useing the string
<%
set con = server.CreateObject (&quot;ADODB.CONNECTION&quot;)
set rs = Server.CreateObject (&quot;ADODB.Recordset&quot;)
con.Open &quot;PROVIDER=SQLOLEDB;DATA SOURCE=Database server Name; UID=sa; DATABASE=DBName&quot;
%>

Yesterday i reintalled the SQL Server., now when i view the ASP file in IE Browser i am getting a error message. Ie the field that i want to display is invalied.

Microsoft OLE DB Provider for SQL Server (0x80040E37)
Invalid object name 'FIELDNAME'.
 
First of all the password is missing from your connectionstring.
To make a connectionstring you can create a new textfile (rightclick desktop => new => text document) => name it connect.udl => double click it to open the connection dialoge => make the connection (make sure to check allow saving password) => click test the connection => click ok => open the udl file with notepad and the bottom line of the text is your connecionstring.

The error you get looks like you are using a wrong name for the database, when you use the above mentioned way you cannot provide wrong names because you selecd the database from a dropdown list.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top