Can someone clear this up for me?

Is DBI some sort of implementation of Win32::ODBC or is it an entity in and of itself?

The reason I ask is because Brett said this:

"I was going to suggest that also, but I think they were using Win32::ODBC,
which I don't believe supports placeholders."

I am using DBI, so does it support placeholders?

I have gone through all of your suggestions for my problem, and it is still failing to 
input the new data into the table.  I'll post the error messages that show up in my 
Apache error log file:


[Thu Jun 07 11:32:04 2001] [error] [client 127.0.0.1] DBD::ODBC::st execute failed: 
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. 
(SQL-37000)(DBD: st_execute/SQLExecute err=-1) at 
c:\PROGRA~1\APACHE~1\APACHE\CGI-BIN\ADDTOF~1.PL line 27. 

[Thu Jun 07 11:32:04 2001] [error] [client 127.0.0.1] [Microsoft][ODBC Microsoft 
Access Driver] Syntax error in INSERT INTO statement. (SQL-37000)(DBD: 
st_execute/SQLExecute err=-1) at c:\PROGRA~1\APACHE~1\APACHE\CGI-BIN\ADDTOF~1.PL line 
27. 


Here is my full source:


#!c:\perl\bin\perl -w
#################################################################                      
                                                                                       
                                                                 #Add new frequencies 
to database                                                              #
#                                                             By David Williams        
               #
#                                                                                      
                        #
#################################################################
use cgi;
use DBI;                                                                               
                    
$dbh = DBI->connect('dbi:ODBC:freq');                                                  
                    
$co = new CGI;                                                                         
                    
print $co->header, $co -> start_html(title=>'Canadian Online Radio Frequency 
Database'),                   
$co->center($co->h1('Thanks using our database!')), $co->h3('Here is what you 
submitted...'),$co->hr;           
print $co->hr;
print "Data Added<BR>\n";                                                              
                               
$newfreq=$co->param('txtFREQ');
$newloc=$co->param('txtLOC');
$newdesc=$co->param('txtDESC');
$newfreqtype=$co->param('txtFREQTYPE');
$newcat=$co->param('txtCAT');
$newcall=$co->param('txtCALL');
$newtx=$co->param('txtTX');
$sqlstatement = "INSERT INTO Full (freq, loc, desc, freqtype, cat, call, tx) VALUES 
(?,?,?,?,?,?,?)";
$sth = $dbh->prepare($sqlstatement) || die $dbh->errstr;
$sth->execute($newfreq, $newloc, $newdesc, $newfreqtype, $newcat, $newcall, $newtx) || 
die $dbh->errstr;         ######Line 27
print "Thank you for submitting a frequency!";
print $co->end_html;



And I don't think it matters but just in case it does, I'm using a Windows 98 machine, 
running Apache Web server, and Active Perl


Reply via email to