Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel, Foxpro, Error opening dbf
Message
From
23/10/2003 05:52:52
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00841422
Message ID:
00841456
Views:
19
>Hi, If I save an excell spreadsheet as a DBF and try to open that
>DBF immediately, I get an error: file access denied. On the other hand,
>if I insert a short delay after saving the file to dbf, no problem. Is
>there a better way to handle this problem?
>Thanks
>Steve
>
>o.Application.DisplayAlerts = 0
>o.Application.ActiveWorkbook.SaveAs("C:\d\basket\basket.dbf",xlFileFormat)
>o.Quit()
>** the file is saved
>
>close all
>use
>
>** here is the delay
>xy = 10000
>do while xy>0
> ?? xy
> xy=xy-1
>enddo
>
>** now I can open it in foxpro
>SET CPDIALOG OFF
>use basket

Steve,
Have the delay but do not do it a fixed delay or dependant on CPU speed as Houston noted.
Instead check you can access the file RW. ie:
lcFile = "C:\d\basket\basket.dbf"
declare Sleep in win32API integer dwMillisecs
lnHandle = fopen(lcFile,12)
do while lnHandle < 0
 Sleep(200)
 lnHandle = fopen(lcFile,12)
enddo
fclose(lnHandle)
use (lcFile)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform