Solved

Try Catch SQL insert PHP VFP oledb

Posted on 2011-09-11
1
864 Views
Last Modified: 2012-05-12
In my PHP script to connect Visual Foxpro with a SOAP web services server I would like to write the errors occured, directly in the Visual Foxpro tables. My interface between PHP and the VFox tables uses VFP Ole DB provider.
When I try to use the PHP Try Catch clause I never succeed wrting the errors returned in an error log.
All the other fields to log the error are writen without any issue. The sql command that I was trying to execute and returned an error, can't be writen in the error log VFox table.
I enclose my PHP scripts and some files with the command i'm trying to record in the error log table.
 PHP-interface-VFPoledbsetup.pdf
0
Comment
Question by:luciliacoelho
1 Comment
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 500 total points
ID: 36522300
'engano_aAW170AvariavelYEMAILSYnaoencontroupontoKincorrerAPZcriaremans_presAPreceitVerro_wsVtipoerroVrequestkeyVcod_reqVemailsVdtenvioVn
reqFPvaloresAPY2123451121928YVY0002000600010017YVYAYVYRegistoPrescricaoMedicamentosT2d333832353238333633313437303634TbdnpT280127
5TbdnpT28122514YV550VYruipontosantosATspsipontoptYVY11T09T201123A11A25YV94FPZFP'

Is too long, string literals can only be up to 254 chars long.

If you want to update a memo field with longer texts, then you could write this as 'part1(max254)'+'part2(max254)'+'part3max(254)' as split strings each maximum 254 chars long, in this case for example that could be:

UPDATE mafxpt SET env_erro ='engano_aAW170Avar...'+'reqFPvaloresAPY...'+'5TbdnpT28122514Y...'
WHERE nreq = 200"

Bye, Olaf.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now