Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Mysql database connection variables

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,36976
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Mysql database connection variables
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Mysql database connection variables - 8/14/2006 4:13:53 PM   
  Aitchi

 

Posts: 6
Score: 0
Joined: 8/14/2006
Status: offline
hi there everyone, is what i am trying to do is hook up mysql databas with my new game that we are in the process of developing....
Your connection string has been corrected, but your connection variable has not been declared, so there is now a coding issue.
that second line is what the guys from my server sent me.
Below is what i have on the signupform.asp on my website.
I am just wondering where and what variable I have to declare so that my website connects to the sql server where my database resides....
I'm hoping it's nothing to difficult!!!
Cheers from downunder australia!
hope someone knows......
the information in connect_string is the same in my global.asp.

      

this is the error i get when that page tries to load
ADODB.Connection.1 (0x80020009)
Empty connection string.



Conn.Open strConnectionString.
^^^^^^^^^^^^^^^^^^^ is the line in the last post that it tells me something is wrong.
can anybody possibly shed a little light on it for me?
Cheers
Aitchi

EDITED BY EBGREEN TO ADD CODE TAGS AND MERGE TWO THREADS

< Message edited by ebgreen -- 8/14/2006 11:21:30 PM >
 
 
Post #: 1
 
 RE: Mysql database connection variables - 8/15/2006 9:59:43 PM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
From what I see is that you're calling strConnectionString by itself...

quote:


strConnectionString = Application("strConnectionString")
[...]
'open the Connection using solids as DSN
Conn.Open strConnectionString


_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to Aitchi)
 
 
Post #: 2
 
 RE: Mysql database connection variables - 8/16/2006 2:23:03 PM   
  Aitchi

 

Posts: 6
Score: 0
Joined: 8/14/2006
Status: offline
so how do i fix it?

(in reply to Snipah)
 
 
Post #: 3
 
 RE: Mysql database connection variables - 8/16/2006 2:39:48 PM   
  Aitchi

 

Posts: 6
Score: 0
Joined: 8/14/2006
Status: offline
this is what i have now

<!-- #include virtual="/includes/headervisitor.asp" -->

<% Header "Signup Form" %>

<BR>

<%

'Declare variables

Dim Conn, RS,Returned,strConnectionString, SQL


'Create a database connection object
strConnectionString = Application("strConnectionString")

Set Conn = server.CreateObject("ADODB.Connection")

'create Recordset object

set RS = Server.CreateObject("ADODB.Recordset")


'open the Connection using solids as DSN

Conn.Open strConnectionString =mysql_connect ("localhost", "????????", "?????")

Set objComm2 = Server.CreateObject("ADODB.Command")

objComm2.ActiveConnection = Conn

'if database could not be connected, redirect to error page and diaplay error message 400

if Conn.State = 0 then

Response.Redirect "solPRError.asp?ErrorCode=400"

end if
'Start Connection object
'Set Conn = Server.CreateObject("ADODB.Connection")
'Conn.ActiveConnection = Conn
'Conn.Open(Sql) = connect_string = "Driver={Mysql}; Server=localhost; Database=goldf3_version1database; UID=????????; PWD=??????"
'const string = "Driver={Mysql}; Server=localhost; Database=goldf3_version1database; UID=????????; PWD=????????"
'SqlConnection connection = new SqlConnection,(connectionString)
'SqlConnection connection = SqlConnection,(connectionString)
'connection.Open()
'Check if space is available
SQL = "SELECT COUNT(*) AS NumTrial FROM " & GameAbbreviation & "Players"
Set Returned = Conn.Execute(SQL)

If CInt(Returned("NumTrial")) >= GameMaxPlayers Then
%>
All <%= GameMaxPlayers %> account slots are currently occupied. Please check back tomorrow to see if some
are available - idle accounts are removed nightly.

<% Else %>

Fill out this form to create a new account. Be sure to double check all your entries to make sure they are
correct.
<BR><BR>
<B>Note About Multiple Accounts</B><BR>
Multiple accounts absolutely are not tolerated on <%= GameName %>. Any user found to hold more than one account
will have all accounts involved deleted. There are no second chances, and this rule is actively enforced.
<BR><BR>

<FORM action="signup.asp" method="POST">
<CENTER>
<TABLE cellspacing="5" cellpadding="0" border="0">
<TR>
<TD><B>Username (2-20 chars):</B></TD>
<TD><INPUT type="text" name="username" maxlength="20"></TD>
</TR>
<TR><TD colspan="2">Your username is very important;
it is the name everyone else in the game will know you by. Think carefully before choosing it because you can't change
it later.</TD></TR>

<TR>
<TD><B>Email (6-40 chars):</B></TD>
<TD><INPUT type="text" name="email" maxlength="40" value="<%= Request.Form("email") %>"></TD>
</TR>


<TR><TD colspan="2">Your email address must be one that you have access to, because
your password will be emailed there.</TD></TR>


<TR><TD colspan="2" align="center">

<INPUT type="submit" value="Create Account">
</TD></TR></FORM>
</TABLE>
</CENTER>

<%
End If
Returned.Close


'Clean up
Set Returned = Nothing
Conn.Close
Set Conn = Nothing

%>
<BR>
<CENTER><A href="tos.asp"><B>Terms of Service</B></A></CENTER>
<!-- #include virtual="/includes/footervisitor.asp" -->

and this is the error i am getting
Error Type:
ADODB.Connection.1 (0x80004005)
SQLState: IM002 Native Error Code: 0 [DataDirect][ODBC lib] Data source name not found and no default driver specified
/signupform.asp, line 25

(in reply to Aitchi)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Mysql database connection variables Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts