Solved

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

Posted on 2011-02-13
7
655 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

623 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