There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
PHP: Converting from ODBC to DSN-less connection


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
maxormark's Avatar
Junior Member with 16 posts.
 
Join Date: May 2003
Location: London, England
11-Nov-2003, 05:03 PM #1
PHP: Converting from ODBC to DSN-less connection
I've developed a site www.kitkrazy.com using PHP, Access and an ODBC connection. It works very well ... most of the time.

Every now and again -- say every three months -- the site crashes, and I get the error message ...

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too many client tasks.,

Most recently I got ...

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] System resource exceeded., SQL state S1001 in SQLExecDirect in E:\home\Default\kitkrazy.com\htdocs\include\topthree.php on line 15
[Microsoft][ODBC Microsoft Access Driver] System resource exceeded.

When I challenge the hosting company on this they always advise me to use a DSN-less connection. Well, it's got to the point where I'm thinking to myself, why don't I just go DSN-less and the hell with it.

So I took a look. And it seems that I'm going to have to rewrite all my SQL queries and database calls. Unless you know different ...

Is there a simple way to convert all my code from ODBC to DSN-less?

max
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
11-Nov-2003, 05:20 PM #2
You should probably convert to MySQL or a real database if you are having trouble with too many users accessing the database. You may also want to check all of your code to see that it is clean and you are closing all open object when the program is done with them. You will have the exact same problem with with a DSN-less connection and it will actually slow your site down. Rewriting the connection string is the only change you will need to make and if you use an include file for the DB connection string all you need to do is change one file.
__________________
**Disclaimer** Anything below this line ^ is part of my signature for those that may be confused

Sadly, there are no integers on this scale, so your gangly adolescent attempt to be clever has proved futile....Dieter

I have the right "NOT" to be tolerant of others because they are different, weird, or tick me off.....Parody of Andy Rooney

There are no stupid questions, but there are a LOT of inquisitive idiots.
maxormark's Avatar
Junior Member with 16 posts.
 
Join Date: May 2003
Location: London, England
12-Nov-2003, 03:31 AM #3
I must say I had considered converting to MySQL, especially after checking that the code WAS clean. I have no experience of MySQL and idea how to make the change so that all the associations are preserved; any suggestions?

In the meantime, my current connection string (contained in an include file is ...

$odbc = odbc_connect ('myDB', 'root', '') or die( "Could Not Connect to ODBC Database!" );

What should it be for DSN-less?
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:10 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.