Solved

ASP  to MySQL Database Connection - Connected but has errors

Posted on 2008-10-24
11
411 Views
Last Modified: 2012-05-05
I have a multi-user website that I wrote in ASP with a MySQL backend. I use several include files to load various pages based on request by the user. However, I do not think I have made a database connection efficient enough.

Overall connection type used and how database information is served:

Top of my page I have my odovbs.inc file and just below I have my connection string in a separate file
i.e    <!--#include file="sqlConnect/adovbs.inc" -->
      <!--#include file="sqlConnect/ttiAConnect.asp" -->
My connection string has another include file in it named chkUser_inc.asp, which is the file that  tracks users throughout the site which compares a cookie issued to the user with the user log file, which is written to after they connect.

I have six (6+1) other include files that are added for:
1. checking for what page the user is on
2. current_page
3. logo include file
4. main_menu
5. main_page content (which has an include file for serving main_content)
6. now my footer include file, which finally closes the database connection.

When more than 1 user is on, 50% of the time I have errors that tell me my database connection has gone away. I need some ideas how to resolve this problem, as I have disabled new user sign-ups until it is working properly. Any suggestions would be greatly appreciated.
0
Comment
Question by:Tom Cullen
  • 7
  • 4
11 Comments
 
LVL 7

Expert Comment

by:bluV11t
ID: 22798009
Could you please post the error you get? What type of locking are you using for your database connection? Could you please post some code of a select or input to DB? Is there a separate log file for all users?
0
 
LVL 1

Author Comment

by:Tom Cullen
ID: 22798095
I cannot quote the exact error for my connection, but it starts with the chkUser_inc.asp file and it always post line 21. I have attached the asp file. Every user is posted to the same log file, however when they are viewing it, it is sorted by their id's. As each account member can view their OWN log file.
0
 
LVL 7

Expert Comment

by:bluV11t
ID: 22798276
I'm sorry, I don't see any files attached?
0
 
LVL 1

Author Comment

by:Tom Cullen
ID: 22798377
Don't know why it is not showing up. try going to my download file section, just created and uploaded at: http://www.tuckertekinc.com/dl_files/chkUser_inc.zip and see if you can get it there.

Thanks blu
0
 
LVL 7

Expert Comment

by:bluV11t
ID: 22798638
Hi! You can't attach .asp files, just bmp, doc, gif, jpg, jpeg, log, mdb, pdf, png, txt, xls or zip

Your code looks ok so far. This line is where the error occurs ?       set rsUserValidate = dbConn.Execute(strSQL)

Could you post the rest of your code, please?

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 1

Author Comment

by:Tom Cullen
ID: 22798726
Hi blu, thank you for the reply again. I did attach a zip file, as the posting that I sent you to download. What other type of code do you want, the include files? Much like I have for my scripts? There is a lot :)
0
 
LVL 1

Author Comment

by:Tom Cullen
ID: 22798801
Hi blu, file to download with all includes necessary: http://www.tunckertekinc.com/dl_files/all_asp_includes.zip
0
 
LVL 1

Author Comment

by:Tom Cullen
ID: 22798831
Blu, I typed the wrong url in previous post: http://www.tuckertekinc.com/dl_files/all_asp_includes.zip
0
 
LVL 1

Author Comment

by:Tom Cullen
ID: 22801552
Hi Blu, here is the error Message I have been getting. Showed up again.

<!------
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[MySQL][ODBC 3.51 Driver][mysqld-4.1.22]MySQL server has gone away

D:\HSHOME\VELAOPRO\TUCKERTEKINC.CA\MEMBERS\SQLCONNECT\../../include/chkUser_inc.asp, line 23
------!>
0
 
LVL 7

Assisted Solution

by:bluV11t
bluV11t earned 100 total points
ID: 22806589
Hi!

http://dev.mysql.com/doc/refman/5.0/en/gone-away.html 

I think I need to se  <!--#include file="sqlConnect/adovbs.inc" --> and <!--#include file="sqlConnect/ttiAConnect.asp" -->

Did you remove the zip-file? I get a 404 file not found from this url http://www.tuckertekinc.com/dl_files/all_asp_includes.zip



0
 
LVL 1

Accepted Solution

by:
Tom Cullen earned 0 total points
ID: 22809123
I have found a solution to my problem, which was having more than 1 connection type to my database. Thank you for your time BluV11t, I am still willing to provide some points to you for any efforts that you have put in. Please let me know? Thank you again for your time.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL BACKUP - 2008 R2 8 62
MySQL left join performance 4 30
Problem with Simple PHP/mySQL Query 3 51
How to load 2 images in same column in Delphi 2 33
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article describes some very basic things about SQL Server filegroups.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now