Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using ADO with Perl

Status
Not open for further replies.

yelimeli

Programmer
Jun 6, 2000
10
US
can anybody please tell me how i can add to a database using ADO. i'm trying the following code<br><br>use OLE;<br>use DBI;<br>$str='c:\abc1.doc';<br>$Conn= CreateObject OLE &quot;ADODB.Connection&quot; ¦¦ die &quot;CreateObject: $!&quot;;<br>$rs=CreateObject OLE &quot;ADODB.Recordset&quot; ¦¦ die &quot;CreateObject: $!&quot;;<br>$cmd=CreateObject OLE &quot;ADODB.Command&quot; ¦¦ die &quot;CreateObject: $!&quot;;<br>$Conn-&gt;Open('Provider=MSDASQL.1;Persist Security Info=False;Data Source=chumdb');<br>$cmd-&gt;{'ActiveConnection'} = $Conn;<br>$cmd-&gt;{'CommandType'} = adCmdTable;<br>$cmd-&gt;{'CommandText'} =&quot; resume&quot;;<br>$rs-&gt;{'CursorType'} = adOpenStatic;<br>$rs-&gt;{'LockType'} = adLockOptimistic;<br>$rs-&gt;Open($cmd);<br>#$rs-&gt;Open( 'resume', $Conn);#, adOpenStatic, adLockOptimistic, adCmdTable);<br>$str1=$rs-&gt;Fields(0)-&gt;Value;<br>print $str1;<br>$rs-&gt;AddNew (0,$str);<br>#$rs-&gt;Update();<br><br>&nbsp;but no row is getting added. Please help me.<br><br>Thanks & Regards<br>Srinivas <br><br><br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top