Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Re: Re: Inserting values into MS Access sub tables

by LanceDeeply (Chaplain)
on Jul 09, 2002 at 21:55 UTC ( #180623=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Inserting values into MS Access sub tables
in thread Inserting values into MS Access sub tables


what was the error message you received?
if you're having trouble coding up it up, here's a shot at it:
sub LookupServerID { # get the servername that was passed into the function my $serverName = shift; # build the sql to select the server_id my $sql = "select server_id from server_tbl where server_name = '$ +serverName'" # execute the sql with the open $perms_db object if ($perms_db->Sql($sql)) { # error during sql! print "Error:" . $perms_db->Error() . "\n"; # return a value anyway and let the caller check for -1 return -1; } # process the result set $perms_db->FetchRow(); # get the first row within the result set my(%data) = $perms_db->DataHash(); # return the server_id to the caller return $data{'server_id'}; # PLEASE NOTE: this code does not watch out for the case where th +e server_name does not exist. you should code for this case. }

You should really take a look at this page for a good tutorial for Win32::ODBC.
There's a couple of examples there from the guys who wrote the module.

OK there champ- take another whack at it.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2022-08-16 04:58 GMT
Find Nodes?
    Voting Booth?

    No recent polls found