Solved

ASP  to MySQL Database Connection - Connected but has errors

Posted on 2008-10-24
11
414 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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
 
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

Webinar: MariaDB® Server 10.2: The Complete Guide

Join Percona’s Chief Evangelist, Colin Charles as he presents MariaDB Server 10.2: The Complete Guide on Tuesday, June 27, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…

728 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