Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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
?
657 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 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

718 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