Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

ASP to MySQL Database Connection - Connected but has errors

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
Tom Cullen
Asked:
Tom Cullen
  • 7
  • 4
2 Solutions
 
bluV11tCommented:
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
 
Tom CullenFounder / DeveloperAuthor Commented:
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
 
bluV11tCommented:
I'm sorry, I don't see any files attached?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Tom CullenFounder / DeveloperAuthor Commented:
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
 
bluV11tCommented:
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
 
Tom CullenFounder / DeveloperAuthor Commented:
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
 
Tom CullenFounder / DeveloperAuthor Commented:
Hi blu, file to download with all includes necessary: http://www.tunckertekinc.com/dl_files/all_asp_includes.zip
0
 
Tom CullenFounder / DeveloperAuthor Commented:
Blu, I typed the wrong url in previous post: http://www.tuckertekinc.com/dl_files/all_asp_includes.zip
0
 
Tom CullenFounder / DeveloperAuthor Commented:
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
 
bluV11tCommented:
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
 
Tom CullenFounder / DeveloperAuthor Commented:
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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now