Solved

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

Posted on 2011-02-13
7
643 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 500 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Read about achieving the basic levels of HRIS security in the workplace.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now