Click to See Complete Forum and Search --> : xp_write_file problem


cheewex
04-16-2007, 08:30 PM
hi guys. new here. have a problem using xp_write_file system procedure. front end: VB6. backend: sybase. OS: Win98. i store images in the database (long binary) using xp_read_file and everything is fine. retrieving is the problem using xp_write_file sys function. when executed in adaptive anywhere interactive sql, xp_write_file is ok but when called in vb6 using connection.execute, no output. no error messages. xp_read_file is ok in vb6. anyone whose got the wizardry in this?? any help will be very much appreciated....

Phil Weber
04-16-2007, 11:06 PM
When you test it in isql, are you using the same credentials that your VB app uses? Extended stored procedures generally require dba permissions; I suspect that you're authenticating as dba in isql, but not in your VB app.

cheewex
04-17-2007, 06:49 AM
yup. DBA. i already have executed xp_read_file from the App. it worked just fine. but not with xp_write_file.

Liam-Cavanagh
04-17-2007, 01:40 PM
Keep in mind that the file will be written to a directory relative to where the engine was started. For example if you are running your VB app from MachineA and the db engine is running on MachineB, if you tell it to write to d:\temp (which exists on MachineA but not on MachineB) it will not work since it is trying to find d:\temp on the machine relative to where the engine was started.

Could that be the problem? If not, try running the engine with -z option to see if you can tell what the actual request to the engine is.