Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Inserting records in MS Access

by 2501 (Pilgrim)
on Dec 06, 2000 at 05:23 UTC ( [id://45154]=note: print w/replies, xml ) Need Help??


in reply to Inserting records in MS Access

I'd recommend connecting with Win32::ODBC and then it is just a matter of knowing your SQL.
examples would be:
update <tablename> set <fieldname>=<value> where <conditions> delete from <tablename> where <conditions> or insert into <tablename> (<field1>,<field2>) values(<value1>,<value2>)
that should be enough to get you tinkering with it.
A helpful trick for learning is to build your SQL statements with the query generator and choose to view the raw SQL.
Also here are a couple of quicky subs you can use to goof with.
sub db_connect { $DSN = "foo"; if (!($db = new Win32::ODBC("dsn=bar;uid=user;pwd=pass"))) { print "Error connecting to $DSN\n"; print "Error: " . Win32::ODBC::Error() . "\n"; exit; } } sub do_query { # reads from a var called $SQL if ($db->Sql($SQL)) { print "SQL failed. \n"; print "Error: " . $db->Error() . "\n"; $db->Close(); exit; } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-03-29 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found