Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

ASP & Database Connection Question
Hi.  I don't know a whole bunch about html and asp pages, but I thought

I'd give it a try to see if I could get it to work.  I found an example

for a calendar event page from Microsoft at:

http://msdn.microsoft.com/library/d...y/en-us/dnas...



So using this example, I saved all the examples for each part of the
code as asp pages.  I created a default htm page which opens the asp
pages.  The code for that is:


<html>


<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Calendar</title>
</head>
<frameset cols="120" border=0 frameborder="0">
<frame name="MAIN" src="calendar.asp" noresize >
</frameset>
</html>


I opened this all in Front Page and published it to my local inetpub
directory.  When trying to run it, I get the following error:


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified
/calendar/Header.asp, line 43


I'm not sure what is causing this.  Line 43 on the header.asp page is
blank, but anyway...  I did check to make sure my connection string was

correct, with no typos.  My modified GetDataConnection function is now:



function GetDataConnection()
dim oConn, strConn
Set oConn = Server.CreateObject("ADODB.Connection")

strConn = "Provider=SQLOLEDB.1; Persist Security Info=False; "
strConn = strConn & "User Id=CCLead; Password=xxxx;"
strConn = strConn & "Initial Catalog=CC Leadership; "
strConn = strConn & "Data Source=WBCORP501 "

oConn.ConnectionString = strConn
oConn.Open
set GetDataConnection = oConn
end function


I feel sure that I am missing something obvious, but not sure what.
Any suggestions for a newbie?


Thanks,
Jennifer


Report this thread to moderator Post Follow-up to this message
Old Post
Jennifer
05-19-06 11:56 PM


Re: ASP & Database Connection Question
"Jennifer" <J.Evans.1970@gmail.com> wrote in message
news:1148075381.895495.78560@y43g2000cwc.googlegroups.com...
> Hi.  I don't know a whole bunch about html and asp pages, but I thought
>
> I'd give it a try to see if I could get it to work.  I found an example
>
> for a calendar event page from Microsoft at:
>
> http://msdn.microsoft.com/library/d...y/en-us/dnas...
>
>
>
> So using this example, I saved all the examples for each part of the
> code as asp pages.  I created a default htm page which opens the asp
> pages.  The code for that is:
>
>
> <html>
>
>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=windows-1252">
> <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <title>Calendar</title>
> </head>
>         <frameset cols="120" border=0 frameborder="0">
>                 <frame name="MAIN" src="calendar.asp" noresize >
>         </frameset>
> </html>
>
>
> I opened this all in Front Page and published it to my local inetpub
> directory.  When trying to run it, I get the following error:
>
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC Driver Manager] Data source name not found and no
> default driver specified
> /calendar/Header.asp, line 43
>
>
> I'm not sure what is causing this.  Line 43 on the header.asp page is
> blank, but anyway...  I did check to make sure my connection string was
>
> correct, with no typos.  My modified GetDataConnection function is now:
>
>
>
> function GetDataConnection()
>    dim oConn, strConn
>    Set oConn = Server.CreateObject("ADODB.Connection")
>
>    strConn = "Provider=SQLOLEDB.1; Persist Security Info=False; "
>    strConn = strConn & "User Id=CCLead; Password=xxxx;"
>    strConn = strConn & "Initial Catalog=CC Leadership; "
>    strConn = strConn & "Data Source=WBCORP501 "
>
>    oConn.ConnectionString = strConn
>    oConn.Open
>    set GetDataConnection = oConn
> end function
>
>
> I feel sure that I am missing something obvious, but not sure what.
> Any suggestions for a newbie?
>
>
> Thanks,
> Jennifer

You are mixing types in your connection string. You are using (in the
beginning) what is known as a "DSN-less" (DSN = Data Source Name)
connection. But then you are providing a DSN (DataSource=WBCORP501). DSNs
are setup using ODBC Manager in Control Panel. Get rid of the data source
line and replace it with "Server=your_SQLServer_name" or
"Server=your_SQLServer_ip_address".
Alternatively, get rid of everything *but* the DataSource= line and setup a
DSN with the name WBCORP501 in ODBC. FYI the best performance will be
obtained using a DSN-less connection (it removes an extra layer of
complexity - i.e., ODBC).



Report this thread to moderator Post Follow-up to this message
Old Post
Ron Hinds
05-19-06 11:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:10 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.