Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO, vfpoledb and Large Foxpro Tables
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00659581
Message ID:
00659585
Views:
25
It could be that your first connection has exclusive use of the database. Issue a command, using the same connection and set exclusive off. Then open both recordsets.

Also, where are you opening cnClient connection? I don't see the code. Is there a reason you want to use a separate connection for each recordset?


>I am working with some large FoxPro Tables (Table 1 has 64K+ records and Table 2 has 350K+ records). It is taking an incredibly long time to just open up these tables in a recordset. After playing around, I noticed the quickest way to open these up was using the following commands:
>
> rs1.Open "Table1", cnClient, adOpenKeyset, adLockReadOnly, 512
> rs2.Open "Table2", cnServer, adOpenKeyset, adLockReadOnly, 512
>
>However, I am getting the following error when executing the rs2.open command: Run-time error ‘-2147467259 (80004005)’: File is in use.
>
>There are no files being used … Any help or suggestion on working with large tables would be greatly appreciated.
>
>Below is the entire code:
>
>Public cnServer As New ADODB.Connection
>Public cnClient As New ADODB.Connection
>
>Public Sub Main()
>
> Dim rs1 As New ADODB.Recordset
> Dim rs2 As New ADODB.Recordset
> Dim sConnect As String
>
> sConnect = "Provider=VFPOLEDB.1;Data Source=m:\Data.dbc;"
>
> With cnServer
> .CursorLocation = adUseServer
> .Mode = adModeRead
> .ConnectionString = sConnect
> .Open
> End With
>
> rs1.Open "Table1", cnClient, adOpenKeyset, adLockReadOnly, 512
> rs2.Open "Table2", cnServer, adOpenKeyset, adLockReadOnly, 512
>
>End Sub
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform