Click here to get back home

ASP - data connection question

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
ASP - data connection question Jennifer 05-19-2006
Get Chitika Premium
Posted by Jennifer on May 19, 2006, 5:23 pm
Please log in for more thread options


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/default.asp?url=/library/en-us/dnasp/html/calendar.asp

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


Posted by Jennifer on May 19, 2006, 5:30 pm
Please log in for more thread options


I realized I made a typo above. I should have copied and pasted this,
but chose to type it out instead. The real GetDataConnection function
is

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


Posted by Jennifer on May 19, 2006, 5:32 pm
Please log in for more thread options


Okay, I'm sure you are all shaking your heads by now and wondering who
the heck the idiot is that's posting this, right? Well, last time I
copied and pasted from the previous post and didn't make the change I
needed. So again, here is the REAL correct funtion (it's just a
correction of semi colons in the connection string):

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


Posted by Harlan Messinger on May 19, 2006, 5:35 pm
Please log in for more thread options


Jennifer wrote:
> 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/default.asp?url=/library/en-us/dnasp/html/calendar.asp
>
> 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:

This isn't a question about HTML, it's about ASP. Best to find an ASP
newsgroup.

Similar ThreadsPosted
DHTML question: DOM access to December 17, 2004, 6:05 am
Data January 19, 2005, 5:21 pm
Meta data October 2, 2004, 1:25 am
data from one web page to another? October 25, 2004, 7:39 pm
retrieving data from a form August 28, 2004, 6:21 pm
What's being sent to the website to retrieve this data? March 1, 2005, 10:36 am
Transferring Data between pages April 13, 2005, 9:42 am
Realtime data in a web page March 10, 2008, 2:32 pm
Continuously Growing Data August 14, 2008, 10:06 pm
Passing Data without Submit/Input October 6, 2004, 12:25 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap