If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > using ASP to use a MySQL database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-07-05, 07:04
parmy parmy is offline
Registered User
 
Join Date: Jan 2005
Posts: 18
Question using ASP to use a MySQL database

Hi guys i've got a little problem when conencting to my mysql database. i am a new user to ASp and the IIs is a new concept to me. all my asp pages are stored in my C:\intepub directory. i have created an ODBC/dsn mysql connection to use with this coding. However when opening my test.asp it shows the 'couldn't connect to database' error. IS there anythign else i have to do when running asp pages? or is there something just wrong with the code below? i'm really stuck with this one and i'd be greatful for any help...

thanks everyone

test.asp:

<%
on error resume next
dim adoConn
dim adoRS
dim counter
set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "DSN=UgoUnited_dsn"
adoRS.ActiveConnection = adoConn
if adoConn.errors.count = 0 then
response.write "<h2>Fields In The 'Members' Table:</h2>"
adoRS.Open "describe members"
while not adoRS.EOF
response.write adoRS.fields(0).value & "<br>"
adoRS.MoveNext
wend
else
response.write "ERROR: Couldn't connect to database"
end if
%>
Reply With Quote
  #2 (permalink)  
Old 02-08-05, 11:08
White Knight White Knight is offline
Registered User
 
Join Date: Dec 2004
Location: York, PA
Posts: 95
ok I see what you are trying to do But sadly you have got the wrong method

here is a link that will help you

http://www.able-consulting.com/MDAC/...DriverForMySQL
__________________
Sorry to be terse
some say it's a curse
I know it's worse
I'm just diverse
Reply With Quote
  #3 (permalink)  
Old 02-08-05, 15:32
parmy parmy is offline
Registered User
 
Join Date: Jan 2005
Posts: 18
hey, thanks for that. It looks a lot easier that way, i'll give it a go.

cheers!
Reply With Quote
  #4 (permalink)  
Old 02-10-05, 12:13
parmy parmy is offline
Registered User
 
Join Date: Jan 2005
Posts: 18
Using the script

hi there, thanks for the link you gave me concerning my post:

http://www.able-consulting.com/MDAC/...BC_DSNLess.htm

Sadly i still haven't been able to make a connection using asp pages. where should i add that little bit of ODBC code? should it go into a sperate asp file...or should i replace these lines in my code:

set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "DSN=UgoUnited_dsn"

i'm really stuck and havn't made any progress. i'd be greatful for any advice. thanks for your time.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On