Yes, access is sometimes quirky about longs/memos. Try doing this (in pseudo code) (warning, may wrap long lines): #!perl -w # above line makes sure perl is running with warnings. use strict; # make sure we have strict on to check for dumb typos use DBI qw(:sql_types); # make sure we use DBI and import type names, such as SQL_LONGVARCHAR connect() $sth = prepare()
# only for memos/long fields, where N is the column number $sth->bind_param(N, undef, SQL_LONGVARCHAR); etc $sth->execute(args) If that fails for some reason, let me know. The fall back is to use bind_param() for each of them and pass no arguments to execute(). Regards, Jeff > > Jeff: > > Thank you for your reply. I have updataed both my DBi and DBD- > ODBC packages, but the problem and the error persist. Any other > ideas as to why? > > Brad Smith > > > On 9 Sep 2002 at 15:54, Jeff Urlwin wrote: > > > Brad, > > > > What version of DBD::ODBC are you using? If you are using DBD::ODBC > > 0.28 from ActiveState, then I suggest upgrading to the latest (which > > has a PPM file at ftp://ftp.esoftmatic.com/pub/outgoing/DBI > > > > Please upgrade your DBI too, as you must use the version I have > > uploaded there. > > > > Regards, > > > > Jeff > > > > > > Scenario: > > > > > > I am using the following code to update an Access database. The > > > fields case_notes1...case_notes4 are MEMO fields. Sometimes, I have > > > no problem whatsoever. Other times, I get the following error: > > > > > > DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft Access > > > Driver]Invalid precision value (SQL-S1104)(DBD: > > > _rebind_ph/SQLBindParameter err=-1) at c:/i-networks/soar/cgi- > > > bin/collab_gatekeepers_channel_open.pl line 930. > > > > > > The code: > > > > > > my $dbh = DBI->connect("dbi:ODBC:gatekeepers") || die > > > DBI::errstr; my $sth = $dbh->prepare("UPDATE gatekeepers > > > SET caller_last_name=?, > > > caller_first_name=?, > > > caller_phone_areacode=?, > > > caller_phone_prefix=?, > > > caller_phone_suffix=?, caller_anonymous=?, referral_source=?, > > > referral_source_other=?, > > > caller_callback=?, > > > client_first_name=?, client_last_name=?, > > > client_soc_security=?, > > > client_address=?, > > > client_city=?, client_state=?, > > > client_zipcode=?, client_zipfour=?, > > > client_phone_areacode=?, client_phone_prefix=?, > > > client_phone_suffix=?, client_gender=?, client_age=?, > > > client_race=?, composition=?, > > > composition_other=?, referral_reasons=?, directions=?, > > > outcomes_mental_health_agency=?, > > > outcomes_crisis_services=?, outcomes_senior_ir=?, > > > > > > outcomes_home_and_community_services=?, > > > outcomes_home_health_agency=?, > > > outcomes_adult_protective_services=?, > > > outcomes_medical_facility=?, > > > outcomes_medical_services=?, > > > outcomes_involuntary_psychiatric_hospital=?, > > > > > > outcomes_voluntary_psychiatric_hospital=?, > > > outcomes_detoxification_facility=?, outcomes_law_enforcement=?, > > > outcomes_other1=?, outcomes_other2=?, > > > outcomes_other3=?, outcomes_other4=?, > > > refused_face_to_face=?, refused_recommended_services=?, > > > refused_will_return=?, unable_to_contact=?, > > > > refusal_comments=?, other_actions_comments=?, > > > caregiver_stress=?, condition_of_home=?, > > > economic_problems=?, medication_problems=?, mental_health=?, > > > nutrition=?, personal_appearance=?, > > > personality_changes=?, physical_health=?, physical_losses=?, > > > > social_isolation=?, substance_abuse=?, > > > reason_other1=?, reason_other2=?, > > > case_notes1=?, case_notes2=?, case_notes3=?, case_notes4=?, > > > > last_update_date=?, last_update_name=? > > > WHERE sid = ? > > > ") || die DBI::errstr; > > > > > > $sth->execute( > > > $in{'caller_last_name'}, $in{'caller_first_name'}, > > > $in{'caller_phone_areacode'}, > > > $in{'caller_phone_prefix'},$in{'caller_phone_suffix'}, > > > $in{'caller_anonymous'}, $in{'referral_source'}, > > > $in{'referral_source_other'}, > > > $in{'caller_callback'}, $in{'client_first_name'}, > > > $in{'client_last_name'}, > > > $in{'client_soc_security'}, $in{'client_address'}, > > > $in{'client_city'}, $in{'client_state'}, $in{'client_zipcode'}, > > > $in{'client_zipfour'}, $in{'client_phone_areacode'}, > > > $in{'client_phone_prefix'}, > > > $in{'client_phone_suffix'}, > > > $in{'client_gender'}, $in{'client_age'}, $in{'client_race'}, > > > $in{'composition'}, $in{'composition_other'}, > > > $in{'referral_reasons'}, $in{'directions'}, > > > $in{'outcomes_mental_health_agency'}, > > > $in{'outcomes_crisis_services'}, > > > $in{'outcomes_senior_ir'}, > > > $in{'outcomes_home_and_community_services'}, > > > $in{'outcomes_home_health_agency'}, > > > $in{'outcomes_adult_protective_services'}, > > > $in{'outcomes_medical_facility'}, $in{'outcomes_medical_services'}, > > > $in{'outcomes_involuntary_psychiatric_hospital'}, > > > $in{'outcomes_voluntary_psychiatric_hospital'},$in{'outcomes_detoxif > > > ic ation_facility'}, > > > $in{'outcomes_law_enforcement'}, $in{'outcomes_other1'}, > > > $in{'outcomes_other2'}, $in{'outcomes_other3'}, > > > $in{'outcomes_other4'}, $in{'refused_face_to_face'}, > > > $in{'refused_recommended_services'}, $in{'refused_will_return'}, > > > $in{'unable_to_contact'}, $in{'refusal_comments'}, > > > $in{'other_actions_comments'}, > > > $in{'caregiver_stress'}, $in{'condition_of_home'}, > > > $in{'economic_problems'}, $in{'medication_problems'}, > > > $in{'mental_health'}, $in{'nutrition'}, > > > $in{'personal_appearance'}, > > > $in{'personality_changes'}, > > > $in{'physical_health'}, $in{'physical_losses'}, > > > $in{'social_isolation'}, > > > $in{'substance_abuse'}, > > > $in{'reason_other1'}, $in{'reason_other2'}, $in{'case_notes1'}, > > > $in{'case_notes2'}, > > > $in{'case_notes3'}, $in{'case_notes4'}, $now_date, > > > $new_specialist, > > > $in{'sid'}); > > > > > > $dbh->disconnect(); > > > > > > Any ideas? So far, I have tried enclosing the wildcard variables in > > > the execute() statement in quotes, but that hasn't seemed to work as > > > well as I expected. > > > > > > Thanks in advance > > > > > > Brad Smith > > > > > > > > > > > >