Solved

ASP  to MySQL Database Connection - Connected but has errors

Posted on 2008-10-24
11
410 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
Comment Utility
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
Comment Utility
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
Comment Utility
I'm sorry, I don't see any files attached?
0
 
LVL 1

Author Comment

by:Tom Cullen
Comment Utility
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
Comment Utility
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 1

Author Comment

by:Tom Cullen
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

744 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

10 Experts available now in Live!

Get 1:1 Help Now