Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create Temporary Cursor
Message
From
20/12/1998 14:10:36
 
 
To
15/12/1998 22:05:22
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00167906
Message ID:
00169249
Views:
16
>I don't know how to create Temporary Cursor table in VB6 .. anybody can help me please ? I have tried the following command but does not work : CREATE CURSOR tempcursor (mytext c(256))
>
>
>Winan

Not sure what ADO offers, but in DAO:

If you want a read/write cursor decide what database you want it to be in. It must have an .mdb home. Probably best to keep these out of your main .mdb, so first do something like
dim dbTemp as Database
Set dbTemp = CreateDatabase (tempDir & "temp.mdb", dbLangGeneral)
Now you can use
dbTemp.Execute "CREATE TABLE..." Then use openRecordset on it; this will be your cursor. Then DROP TABLE when you are through with it.

When you exit your app do
Kill tempDir & "temp.mdb"
to get rid of the file.

Long winded, but what isn't in VB table handling.?

Also you may want to check out CreateQueryDef in the VB docs; here's a quote form this entry.

"You can create a temporary QueryDef by using a zero-length string for the name argument when you execute the CreateQueryDef method. You can also accomplish this by setting the Name property of a newly created QueryDef to a zero-length string (""). Temporary QueryDef objects are useful if you want to repeatedly use dynamic SQL statements without having to create any new permanent objects in the QueryDefs collection. You can't append a temporary QueryDef to any collection because a zero-length string isn't a valid name for a permanent QueryDef object."


Tom
Previous
Reply
Map
View

Click here to load this message in the networking platform