Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

In vb6 with  pervasive sql, then call  file with other filename , but same tablename in ddf

Posted on 2011-02-13
7
Medium Priority
?
659 Views
Last Modified: 2012-05-11
I open files like this and works ok"
even if in the table.ddf  the filename is defined as:  MUT.PVW

With vMUT
.Close
.DatabaseName = "J:\PDS\MUT{H05.H05
.Location = .DatabaseName
 Status% = .Open
 .IndexNumber = 2
 Status% = .GetFirst
While Status% = 0
 Debug.Print .FieldValue(0)
 Status% = .GetNext
Wend
end with

So the MUT{h05.h05 is seen this way.
Only using SQL gives a error if file opened is different then in table
 when I call like:   select * from mutaties  
if MUT.PVW exist (wich is in table.ddf the name off file)  no problem
but if not,
 and still did the first lines with opening this file MUT{H05.H05  I get error

I there something I can do in the SQL statement to set direction to the other filename using the default table
(else create for every instance a definition in the table , and if can I do that from VB6 , copying the table ?)


 
0
Comment
Question by:BIAPRO
  • 4
  • 3
7 Comments
 
LVL 28

Expert Comment

by:Bill Bach
ID: 34883919
Yes -- the command is ALTER TABLE tabelname IN DICTIONARY USING 'filename';

This will point your existing definition to a new data file.
0
 

Author Comment

by:BIAPRO
ID: 34884013
This i do on real file mut.pvw, no error
select * from mutaties  where mutboek = '60'  and mutrek <> '1300'  order by mutstuk

then
select * from mutaties  where mutboek = '60'  and mutrek <> '1300'  order by mutstuk,  ALTER TABLE 'MUTATIES' IN DICTIONARY USING 'MUT{H05.H05'

with or without de ,   before the word ALTER  will generate error
0
 
LVL 28

Accepted Solution

by:
Bill Bach earned 2000 total points
ID: 34884122
Please look in the SQL Language Reference manual for more info.
The ALTER TABLE statement needs to be issued separately when nobody else is accessing that table from SQL.
You cannot just add it to an existing statement.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:BIAPRO
ID: 34884165
ok will find out , thanks
0
 

Author Comment

by:BIAPRO
ID: 34897998
Ok that works, but also learned that doing this on multi-user platform will be dangerous, due to other users could open that table at same time, so will only use at stand-alone and/or table name wich are in use with 1 person
0
 
LVL 28

Expert Comment

by:Bill Bach
ID: 34898129
Exactly correct, as indicated above.  If you need to access numerous files from the SQL layer at the same time, then you should really create a DDF definition for each.  With newer versions of PSQL, you may be able to use the PCC or DDF Builder to Export the table schema, and then use CREATE TABLE ... IN DICTIONARY statements to create the other ones.  Please note, though, that this process is not always perfect, so you may have to verify that what you are doing is working perfectly before you do a lot of them.
0
 

Author Comment

by:BIAPRO
ID: 34898220
just wrote a small VB routine wich copies the original table with a new name and add it to the table,  in use software there will a look in a file to see wich tablename to use
thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

916 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