Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 07-11-2003, 01:18 AM   #1
Beta Member
 
Simonliu's Avatar
 
Join Date: Jul 2003
Posts: 1
Question Perl database connection prob

Hi ppl,

I've got this really big problem, where I can't get my Perl script to connect to a MS Access File Database via Win32::ODBC. Basically it doesn't give any error messages but still dies. The code that is most relevant to this problem is:

# Start building the SQL query:
$query = "INSERT INTO MAIN (category, subcategory, url, user) VALUES ($fields{'SelectPrimary'},
$fields{'SelectSecondary'}, $fields{'url'}, $fields{'name'})";

$conn = new Win32::ODBC("website");

if (!$conn) {
die "ODBC DSN error: [$!].\n";

}

Since I'm using Windows 2000 Server, I have managed to capture the SQL transaction details:

submit2 67c-804 ENTER SQLAllocEnv
HENV * 10017E08

submit2 67c-804 EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS)
HENV * 0x10017E08 ( 0x01ba14f0)

submit2 67c-804 ENTER SQLAllocConnect
HENV 01BA14F0
HDBC * 015D4678

submit2 67c-804 EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS)
HENV 01BA14F0
HDBC * 0x015D4678 ( 0x01ba1598)

submit2 67c-804 ENTER SQLDriverConnectW
HDBC 01BA1598
HWND 00000000
WCHAR * 0x1F7D8BF8 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x1F7D8BF8
SWORD 8
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>

submit2 67c-804 EXIT SQLDriverConnectW with return code -1 (SQL_ERROR)
HDBC 01BA1598
HWND 00000000
WCHAR * 0x1F7D8BF8 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x1F7D8BF8
SWORD 8
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>

DIAG [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0)

submit2 67c-804 ENTER SQLErrorW
HENV 01BA14F0
HDBC 01BA1598
HSTMT 00000000
WCHAR * 0x0140F474 (NYI)
SDWORD * 0x015D9258
WCHAR * 0x0140F074
SWORD 512
SWORD * 0x0140F4BC

submit2 67c-804 EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 01BA14F0
HDBC 01BA1598
HSTMT 00000000
WCHAR * 0x0140F474 (NYI)
SDWORD * 0x015D9258 (0)
WCHAR * 0x0140F074 [ 91] "[Microsoft][ODBC Driver Manager] Data source "
SWORD 512
SWORD * 0x0140F4BC (91)

submit2 67c-804 ENTER SQLFreeConnect
HDBC 01BA1598

submit2 67c-804 EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS)
HDBC 01BA1598

submit2 6cc-6d4 ENTER SQLAllocEnv
HENV * 10017E08

submit2 6cc-6d4 EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS)
HENV * 0x10017E08 ( 0x01ba14f0)

submit2 6cc-6d4 ENTER SQLAllocConnect
HENV 01BA14F0
HDBC * 015D4678

submit2 6cc-6d4 EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS)
HENV 01BA14F0
HDBC * 0x015D4678 ( 0x01ba1598)

The thing says I've got an error, but I've checked and I don't know what its saying!

Thanks!
__________________

Simonliu is offline   Reply With Quote
Old 07-11-2003, 02:30 PM   #2
Site Team
 
David Lindon's Avatar
 
Join Date: Dec 2002
Posts: 15,233
Default

What shows up in your server error log?
__________________
[url=http://www.LNXPS.NET]LNXPS.NET - The XPS Library]
David Lindon is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Refbacks are Off



All times are GMT -5. The time now is 02:44 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0