Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Aiby
Yak Posting Veteran
71 Posts |
Posted - 2004-10-16 : 14:40:56
|
I am looking for a help to Generate a complete CREATE TABLE query to generate an access table run time!CREATE TABLE tblTestTable ( fldID LONG, fldText TEXT(50) , CONSTRAINT fldID PRIMARY KEY (fldID) );This will work quite nicely! But I am looking for, a)How I could fix the fltText fild's property - AllowZeroLenght=True -b)How to send the default valuesc)With out using seperate CREATE INDEX Statment, how can i create Inded filds for each filds along with Primary Key, in the same CREATE TABLE statement:-Note:- for fixing AllowZeroLength - dont suggest to use NOT NULL argument, because it does some thing else as you may ware of !Hopes you peoples are much aware of it, thanking you all. Babye!Aiby Mohan DasSystem AnalystDecibel Infotech P.Ltd.Kerala, IndiaEmail: Aiby@hotmail.com |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2004-10-16 : 14:55:07
|
I'm not clear on whether you're posting a solution or asking for help, or both. I'm moving this to the MS Access forum in any case.If I recall correctly, Jet SQL does not cover all of the features available to create Access objects. Data Access Objects (DAO) does, however. Any solution you might be looking for would best be done via DAO and not SQL. The Access Help file has a section (somewhere, I can't find it now) on all of the DAO objects, methods, etc., that would help you build something like this. |
 |
|
Aiby
Yak Posting Veteran
71 Posts |
Posted - 2004-10-17 : 15:31:51
|
quote: Originally posted by robvolk I'm not clear on whether you're posting a solution or asking for help, or both. I'm moving this to the MS Access forum in any case.If I recall correctly, Jet SQL does not cover all of the features available to create Access objects. Data Access Objects (DAO) does, however. Any solution you might be looking for would best be done via DAO and not SQL. The Access Help file has a section (somewhere, I can't find it now) on all of the DAO objects, methods, etc., that would help you build something like this.
Thank you revolk to transfer the Post to Access forum. And Sorry for the in conventions caused! Actually I didn’t see the Access Forum in main list. Thants why. Yes, I solve the problem temprorly using DAO object! But looking further whether some one can help across DDL , especially to solve at least the INDEX related issue OR some more better solutions!Thank you once againSub FixAllowZeroLength(td As TableDef)Dim F As Field For Each F In td.Fields If F.Type = dbText Or F.Type = dbMemo Then F.AllowZeroLength = 0 ' reasserting the default value End If Next FEnd Sub -------------------------------------------------- db.Execute "CREATE TABLE Table1 (Description TEXT(50))" FixAllowZeroLength db!Table1 ---------------------------------------------------- |
 |
|
|
|
|
|
|