in reply to DBI ODBC CGI Access hangs on execution of select statement

Debug stagewise. If you think the DB is corrupt then why don't you just... Open the database in Microsoft Access, click on the 'Tools' menu and select 'Database Utilities -> Compact and Repair Database'. That will do the repair (if needed) for you.

Next see if you can do a SELECT * from table WHERE lastname LIKE 'A%' directly in Access. This should show you all the lastname A's in your table. If this works then try it with DBI and see if it flies.

If it still does not work then details of you code would be useful. Are you checking return values for instance? Is it a simple time out issue due to a huge return of names? Have you added some print's so you know exactly which line of code is causing the hang?

use CGI; use DBI; my $q = new CGI; my $debug = 1; $debug && print $q->header; $debug && print '<pre>'; $debug && print "connecting.....\n"; my $dbh = DBI->connect(.....); $debug && print "connected\n"; # yada yada

What files are left in your cgi-bin. Where is the DB located. What version of Access, DBI, DBD-OBCD, Perl, Apache. yada yada

There are not a lot of good resons to use a DB as pedestrian as M$ Access for anything serious IMHO. Have you considered using something (almost anything) else? There is a good port of MySQL for Win32 for desktop use and this DB is also proven to work well on the web. Access is not M$ flagship product, SQL Server is so Access is effectively the Windows XP Home of databases. Actually probably the WinME or Win3.0 would be more accurate.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: DBI ODBC CGI Access hangs on execution of select statement
by buttroast (Scribe) on Apr 14, 2003 at 01:19 UTC
    I'm only using Access because I don't know how to use MySQL yet. I think I will try to backup the db and just delete the original...my db is in a general folder one level above my cgi-bin folder. Does it need to be somewhere specific?

      I'm only using Access because I don't know how to use MySQL yet.

      Concepts are all the same. GUI Interface is of course different. You also have a command line interface which is good if you come from *nix but may be very unfaliliar if you were weaned on drag and drool.

      I think I will try to backup the db and just delete the original...

      Why? Just repair it. Make a copy first of course just to be safe. We have all had the M$ hanging data loss blues (BSOD) at one stage of another.

      my db is in a general folder one level above my cgi-bin folder. Does it need to be somewhere specific?

      Not really provided you can connect to it. Just wanted to clarify that it is on localhost and therefore there are no network issues involved. The only real issue is that you don't want it under your HTTP root in a world readable directory assuming that this is a commercial widget and you don't want just anybody walking off with your data. Plus all the usual security stuff.

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

        One of the first things I tried to do was compact and repair it, but it wouldn't let me. It said the database was in use. I rebooted, but forgot to try it again. Thanks buttroast
      I'll post my code later tonight...I'm not at home right now.