[vbRichClient] NewFieldDefs
I guess this one is for Olaf :)
I want to use NewFieldDefs for both cConnection and cMemDB. If I'm reading it right it is just a VB Collection, so I guess it should be provided as pairs in the form "Name,Value"? What's the correct structure/syntax for it?
Also, as cCollection has the property CompatibleToVBCollection may I use it instead to be able to serialize it to json?
Thanks
Re: [vbRichClient] NewFieldDefs
When you do a Forum-Search (in the 'Google Custom Search'-Field at the TopCenter of this Forum-Page),
you will get a handful of Use-Cases with example-code.
E.g. post #9 here: http://www.vbforums.com/showthread.p...=1#post4925461
makes use of it in a simple scenario.
I've introduced that Method only for convenience (to avoid too many VB6-"Underscore"-LineBreaks,
as well as the Commas).
Programmatically, when you do it as shown in the Demo(s) in this Forum per:
With MemDB.NewFieldDefs
or
With Cnn.NewFieldDefs
...a normal VB6-Collection is returned to make use of its .Add-Method -
Internally the Collection-Reference is shared, so that the next following:
Cnn.CreateTable "SomeTableName"
can make use of its content (which was added on the outside by you),
then ensuring the yet missing Comma-insertion and stuff internally)...
To serialize a Table-Definition, I'd recommend to use (instead of JSON):
Cnn.DataBases(DBNameOrIndex).Tables(TableNameOrIndex).SQLForCreate
which will hand out a String which you can store whereever you want,
directly usable to create a new Table from it on a different Connection...
Olaf
Re: [vbRichClient] NewFieldDefs
Didn't know about that "Google Custom Search", I always use the "forum search" button but found nothing useful.
During the design of a database (in a graphical diagram) I want to attach a definition for every table and every field. Until now I've been assigning XML strings to the Tag property but I want to use OLE Variants.
I think I'll try your cCollection.
Re: [vbRichClient] NewFieldDefs
Quote:
Originally Posted by
Carlos Rocha
Didn't know about that "Google Custom Search", I always use the "forum search" button but found nothing useful.
Yeah, the normal Forum-Search doesn't look very good in comparison.
I also often use the normal Google-Search in a Browser with a "site:"-prefix like:
[site:vbForums.com vbRichClient SomeAdditionalKeyword]
which works as well - and spits out quite a bunch of good links.
Quote:
Originally Posted by
Carlos Rocha
During the design of a database (in a graphical diagram) I want to attach a definition for every table and every field. Until now I've been assigning XML strings to the Tag property but I want to use OLE Variants.
I think I'll try your cCollection.
For the read-direction of an existing Schema, there is already quite a lot of "extended Field-Properties"
available (in the cColumn-Class) - but this one is not writable (to finally map it against a DDL-action).
Though Jason (jpbro) developed something for that purpose already quite some years ago -
(a writable DB-Class-Hierarchy to define new Tables and Fields for SQLite, like wont from DAO or ADOX).
It was thought as a contribution to the SQLite-Classes - and for some time available as a
public SourceZip-Download on his private site (which doesn't exist under its old name anymore).
Maybe when he's stumbling over this thread (or in case you PM him directly), I'm quite sure
he will try to dig out the VB6-Project for you... (it was called "jpbDBFactory" at that time,
and should work in conjunction with the current RC5-SQLite-Wrapper as well).
Olaf
Re: [vbRichClient] NewFieldDefs
Quote:
Originally Posted by
Schmidt
For the read-direction of an existing Schema, there is already quite a lot of "extended Field-Properties"
available (in the cColumn-Class) - but this one is not writable (to finally map it against a DDL-action).
Yes, I need something with Add and Remove, and with a dynamic structure.
Quote:
Though Jason (jpbro) developed something for that purpose already quite some years ago -
(a writable DB-Class-Hierarchy to define new Tables and Fields for SQLite, like wont from DAO or ADOX).
It was thought as a contribution to the SQLite-Classes - and for some time available as a
public SourceZip-Download on his private site (which doesn't exist under its old name anymore).
Maybe when he's stumbling over this thread (or in case you PM him directly), I'm quite sure
he will try to dig out the VB6-Project for you... (it was called "jpbDBFactory" at that time,
and should work in conjunction with the current RC5-SQLite-Wrapper as well).
I have it here since 2009, in a directory named dhIII :D
I'll check it, but I think that cColletion is what I need, specially because of it's serialization abilities
Re: [vbRichClient] NewFieldDefs
Just came across this thread - I've been meaning to update the class-based table definition code to RC5 for a while, so maybe now is the time to start a new Codebank submission. I don't think my classes had any kind of serialization, but it would be easy enough to add this.
Re: [vbRichClient] NewFieldDefs
I already did that, but thank you , bro :)
Re: [vbRichClient] NewFieldDefs
I've posted an updated version that supports RC5 and Serialization/Deserialization here: http://www.vbforums.com/showthread.p...Helper-Classes