Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Insert Values with WIN32::OLE and MS ACCESS

by ask1about (Initiate)
on Aug 09, 2002 at 22:38 UTC ( [id://189079]=perlquestion: print w/replies, xml ) Need Help??

ask1about has asked for the wisdom of the Perl Monks concerning the following question:

hi, I need to insert data into an MS ACCESS database
usingWIN32::OLE (not DBI or WIN32::ODBC, but WIN32::OLE). The following method works for me to read the data from thedatabase: use Win32::OLE; my $db = new Win32::OLE('ADODB.Connection'); $db->open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=data.mdb"); $RS = $db->Execute("SELECT * FROM members"); $usa=$RS->Fields('name')->value; $ema=$RS->Fields('email')->value; print "$usa|$ema<br>"; $RS->MoveNext; $RS->close; $db->close; now i need something similar, but will insert
thevalues "a1" into name and "a2" into email(being examples)
into members table of the database. plz
help...
  • Comment on Insert Values with WIN32::OLE and MS ACCESS

Replies are listed 'Best First'.
Re: Insert Values with WIN32::OLE and MS ACCESS
by simon.proctor (Vicar) on Aug 09, 2002 at 23:15 UTC
    Take a look at my node: on Retrieving the last insert ID with Access. You can use that as a basis for what you want as it covers inserting data using a recordset.

    For anything else you should read up on ADO.
      I did before it didnt't help.
        im guessing this might be a prob with my hosting company. I will consult it with them cuz it worked on my other host.
Re: Insert Values with WIN32::OLE and MS ACCESS
by cacharbe (Curate) on Aug 09, 2002 at 23:04 UTC
    What have you tried?

    Just about everything you need is right there in front of you. What are you having problems with? The SQL statement? How to receive the response from the database object?

    C-.

    ---
    Flex the Geek

      Ye i tried many many times, but it dont work i tried AddNew() method and INSERT INTO members (name,email) VALUES ('a1','a2') but it doesnt insert.

      Ive tried many ways yet none worked, thats the reason why I'm asking.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://189079]
Approved by cacharbe
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-16 15:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found