Quick Search for:  in language:    
MRU,CreateMDB,will,analyze,dump,sturture,Acce
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic
Auto clip picture
By Kenneth. Jakobsen on 6/30


Click here to see a screenshot of this code!Game of life clone (cool math)
By Johannes B on 6/30

(Screen Shot)

String to CHR()
By Nikhil Raj on 6/30


Encryption Decryption Demo
By Nikhil Raj on 6/30


Click here to see a screenshot of this code!Serial Registration
By Christian (eXonite Team) on 6/30

(Screen Shot)

Click here to see a screenshot of this code!Danger:Can pc kill me? interesting article
By Xasan on 6/30

(Screen Shot)

AniViewer
By Jerrame Hertz on 6/30


Click here to see a screenshot of this code!Raw Packet Sniffer
By Coding Genius on 6/30

(Screen Shot)

Check the support of a record set
By Freebug on 6/30


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

CreateMDB v1.0.13 (Update 5)

Print
Email
 
winzip icon
Submitted on: 4/2/2001 8:25:37 AM
By:  
Level: Intermediate
User Rating: By 65 Users
Compatibility:VB 5.0, VB 6.0

Users have accessed this code 18784 times.
 

 
     CreateMDB will analyze and dump the sturture of an Access database into a BAS-module, you can include in your own project. From your own project you can now create an access database on the fly. This project is using ADO/ADOX v2.5 but will also work on v2.1. Updates in v1.0.13 : Minor bug regarding Nullable columns fixed. Updates in v1.0.12 : Minor bug regarding table description fixed, and found a solution regarding Nullable/Allow Zero lengh. Updates in v1.0.11 : More tableproperties added and a MRU list added to menu. Updates in v1.0.10 : Password dialog added, and some minor code updates. Updates in v1.0.9 : Support for Queries aka Views and Procedures and improved Errorhandling.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
3)Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
4/2/2001 10:09:56 AM:Guus
Very nice work you have done there! 
Actually is was looking some something 
like this only not for Access databases 
but for Oracle databases... 4 globes 
for you!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/2/2001 11:09:22 AM:Eric Sanford
Greate code. gave you and excellent. 
only there was a problem with the call 
to CAT.Create in Sub CreateMDB not 
spliting line correctly. other than 
that it works greate for access97.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/2/2001 2:36:47 PM:Paco
i'll check, but looks nice!!! you have 
5 globes
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/2/2001 8:34:32 PM:Blue Sunset Software
Great code. Attractive interface. This 
is what PSC is all about.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/3/2001 12:40:38 PM:daniel
can some one help me, seems as if i an 
having problems with ADOX, cant find 
the reference needed to create the 
DB 
and im not sure what it is i need 
exactly..
thanx
Daniel
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/3/2001 2:29:01 PM:Chad M. Kovac
DANIEL:Select PROJECT, REFERENCES, then 
put a checkbox next to Microsoft 
ADO...
Author: I also had a problem 
with the .BAS file it created.  This 
ADO reference, but also in the CAT 
line.. It placed ...Password=";" Where 
it should have used Password=;" in 
addition to the missing "& _" at the 
end of the last two CAT lines.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/3/2001 2:34:22 PM:Chad M. Kovac
Also, the CreateKeys sub only creates 
the first key... the rest fail with 
Err.number  3265  (after attempting to 
remove the key if it already exists).. 
err.desciption="Item cannot be found in 
the collection corresponding to the 
requested name or ordinal."
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/3/2001 3:23:24 PM:Niels Krogh
Hi everybody, thanks for trying out my 
program - I knew there could be some 
bugs in the code and I have fixed the 
split line error reported by 2 of 
you.
Chat Kovac, is it possible to 
mail the MDB file you have discovered 
the error '3265' - I would like to see 
why you have the problem, I have some 
MDB's where the tables some 2 or more 
key and worked 
nicely.
regards,
Niels Krogh
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/3/2001 4:42:03 PM:Jarek
Is it possible to create AutoNumber 
field, i have field in my access that 
is autonumber fields and the program 
created it as a Number filed.
Other 
than that it's greate program
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/4/2001 11:18:14 AM:Raymond Mitchell
When I try to run your code I get this 
error. The MSCOMCTL.OCX file appears to 
be registered ok Can you give me some 
help? See your code below where the 
error occurs.
Private Sub 
LV_LoadDATABASE(ByVal Node As 
MSComctlLib.Node)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/4/2001 12:17:11 PM:Niels Krogh
Hi, Raymond,
I'm using the Microsoft 
Windows Common Control 6.0 SP4, but it 
is possible to use an earlier Service 
pack from VB6.
However, if you are 
using the Microsoft Windows Common 
Control 5.0 (from VB5.0) the Node 
declaration is little different : Node 
As ComctlLib.Node
It could be your 
problem.
Regards,
Niels Krogh
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/4/2001 2:37:33 PM:Niels Krogh
Hi all,
I have uploaded a newer 
version with some new features and some 
bugfixes.
Feel free to try it 
out...
regards,
Niels Krogh
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/4/2001 2:58:24 PM:RJ Soft of West Tennessee
Real world code! 5 Globes!
Note: You 
left a Stop Statement in WriteKey :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/4/2001 7:50:37 PM:Andrew Shelomanov
Thanks so much for the code. I was 
looking for this app. so many 
days...
6 Globes.
Good luck.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/5/2001 11:10:46 AM:Raymond Mitchell
After a lot of researc I found the 
proble. Thank Heavens for the internet 
searc capability. The problem was that 
my comcat.dll file was corrupted. 
Thanks for your kind assistance.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/9/2001 10:02:01 AM:Afshaad
Is there anyway you can import all 
queries too from the database. That 
would make this application realy 
awesome
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/9/2001 10:55:17 AM:Niels Krogh
To Afshadd.
I will check it in nearest 
fureture, and then you will hear from 
me.
regards, 
Niels K.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/10/2001 4:41:17 PM:Afshaad
Thank man that would really be great. 
Creating Queries would make this 
application awesome.
Thanks again
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/19/2001 10:02:06 AM:Afshaad
This application ROCKS !! i hardly vote 
on PlanetSourceCode but i think i have 
never seen such a professional and yet 
powerful application out in the market 
that can do this.
I give it 5 globes
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/21/2001 11:35:09 AM:Brett Woodward
Amazing program!
I have to report a 
problem that I had and the solution for 
it.  My MDB file has tables with 
autonumber fields, and the .bas file 
created would not create these in the 
new MDB.  I had to set the parent 
catalog in order to make it 
work.
SAMPLE from CreateTables - 
with fix (line 3)
' ===[Create Table 
'AuditLogs']===
  Set TBL = New 
ADOX.Table
  Set TBL.ParentCatalog = 
CAT 'fix
I am also having trouble 
with UniqueKeys.  The code encounters a 
STOP in CreateKeys.  What should really 
happen here?
Keep up the great 
work!
Brett W.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/9/2001 1:44:57 AM:Kevin
Very nice submission! I voted 
excellent.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/15/2001 9:24:53 AM:John
Excellent!  I also enjoyed (and 
imported into my code library) the 
simple splitter implementation.  I will 
probably rewrite the "Create" portion 
to save SQL statements.  (Thinking that 
I can then reverse engineer an Access 
database and rebuild it in SQL Server 
or ORACLE.
Again, Fine Code, Sir!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/22/2001 7:37:31 AM:Mike Canejo

Nice.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/23/2001 3:54:47 AM:Paulius
keep on working. 5 stars
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/20/2001 7:03:26 AM:Dunc
Very nice utility!  Good work!
I did 
find that when I created a bas file for 
Access 2000 and ran it, .Properties(
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/10/2001 4:40:52 PM:William Hunter
This code helped me where others 
failed. A great piece of code from a 
great Coder. Thank you!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/23/2001 4:20:23 AM:me
I'm having the same problem as Daniel; 
can't find a reference to ADOX.  I've 
included ADO 2.1 and 2.6, neither 
worked for me.  Help?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/24/2001 7:16:22 AM:Mondor
I guess your code does not work with 
ADOX 2.6? I remember with previous was 
ok, now it just doesnt work.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/27/2001 3:16:42 AM:Niels Krogh
Hi there,
I've just checked CreatedMDB 
with ADO/ADOX 2.7 but found no 
problems. I know you've tried ADOX 2.6 
- I only have v2.5 and v2.7 on my 
machines, so I can't test with 
v2.6.
Have you tried to create a new 
project with ADOX 2.6, and then added 
som come using the ADOX objects ? - It 
seems that you ADOX isn't installed 
properly.
Regards
Niels K.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/27/2001 9:22:25 PM:guest
i'm having a problem with this code.  
the sub CreateTables bombs on the first 
call of CAT.Tables.Append TBL.  Where 
am I going wrong?  Generated code 
follows:
--- begin snippet 
---
Private Sub CreateTables()
On 
Error GoTo ErrTrap
Dim TBL As 
ADOX.Table
  Set TBL = New 
ADOX.Table
' ===[Create Table 
'Categories']===
  Set TBL = New 
ADOX.Table
  TBL.Name = 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/27/2001 9:24:14 PM:Adam Murray
was cut off... snippet 
continues...
' ===[Create Table 
'Categories']===
  Set TBL = New 
ADOX.Table
  TBL.Name = "Categories"
 Set TBL.ParentCatalog = CAT
TBL.Columns.Append "CategoryID", 
adInteger, 0
TBL.Columns("CategoryID").Properties("Au
toIncrement") = 1 ' True
TBL.Columns.Append "CategoryName", 
adVarWChar, 50
  CAT.Tables.Append TBL
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/28/2001 3:09:46 AM:Niels Krogh
Hi Adam,
I've just test your code 
snippet in a project of my own - 
couldn't see any errors. Do you see an 
error code/description, when you try to 
use the code ? - and which version of 
MDAC are you using ?? - If you mail me 
the BAS-module I could dig into it if 
you like.
Regards,
Niels K.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/2/2001 5:47:45 PM:cynthia
I am having the same problem as Adam 
Murry reported. I have MDAC6
the error 
is:
Item cannot be found in the 
collection corresponding to the 
requested name or ordinal. Err.num  
3265 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/3/2001 7:21:41 AM:Ant
Great code mate!
The only thing is i 
am having trouble with the line 
'TBL.Columns(
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/3/2001 7:23:30 AM:Ant
Was cut 
off..
'TBL.Columns("ContactName").Prope
rties("Jet OLEDB:Allow Zero Length") = 
1’(Err. 3265)
Is there another 
way to set the ‘Allow Zero 
Length’ property? (Access 2000)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/3/2001 7:42:03 AM:Niels Krogh
Hi Ant,
Normally you have to set the 
property to True, but due some German 
and French version of VB, the keyword 
True is replaced bye a numeric value of 
1 (one).
The code 1’ and 
1&H8216, is that generated by CreateMDB 
? (I hope not...)
Recently I found 
out that there is a bug in ADO, when 
using the .Attributes property - see 
link   
http://support.microsoft.com/support/kb/
articles/Q272/0/01.ASP for more 
information.
Regards
Niels Krogh
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/6/2001 12:04:21 PM:doug cranston
I (a newbie to ADO...Taking a VB Class, 
and this caught my eye.) attempted to 
run your application on an existing 
Access 97 file, and I got a popup 
msgbox with "Can't open DB : 
e:\lab5\employees.mdb"
Does not 
create a normal error, and wonder if 
there is something I failed to do.  
Checked, file is not locked. Not in use 
by any other app.  No errors under 
PROJECT|REFERENCES .. Basically, I am 
stymied.
Would appreciate any 
suggestions.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/29/2001 2:45:14 AM:Justin
Excellent timesaving program. I am 
trying to set the "Required" property 
without any success. I think it might 
have something to do with "Jet 
OLEDB:Column Validation Rule", but I 
cannot find and examples of how to use 
it. Any ideas of how to read and set 
the Access "Required" property?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/4/2002 2:04:32 PM:JG
Great code, a real masterpiece!
I am 
trying it and I will report you any 
bugs I find. 
BTW Would you please 
let me know how long it took you to 
create this code?
Bug:
when 
creating the code, the description is 
missing a ""
this is the fix:
Print 
#fHandle, "  TBL.Columns(""" & Col.name 
& """).Properties(""Description"") = 
""" & 
Col.Properties("Description").Value & 
""""
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/7/2002 10:17:42 AM:Niels Krogh
Hi, there
It has been fixed in 
v1.00.0012.
Regards,
Niels K.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/15/2002 11:36:39 AM:Seraphire
This is a fantastic program!  Thank you 
so much for providing this to the open 
source community!  This has saved me 
many many hours of digging through 
MSDN's-less-than-helpful help.  10^10 
globes for you!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/22/2002 2:12:48 AM:Greg Boot
Tried this straight out of the box, so 
to speak. Generates all the code 
required, but when I try to invoke the 
generated "CreateMDB" code I get the 
following error and it creates the 
database with no tables.
"-2147217887 
/ Multiple step OLE DB operation 
generated errors. Check each OLE DB 
status value if available. No work was 
done" 
Have tried a single table with 
just two text fields and a boolean 
field. Any suggestions
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/1/2002 11:25:35 AM:Morgan Haueisen
This is great code but I would like to 
make a change but I can't seem to make 
it work.  How do you create a text 
field that is not required and allows 
zero length strings?  I can get one or 
the other but not both.  Any help would 
be appreciated.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/31/2002 6:41:07 AM:Jimmy Pedersen
Hi. Im sorry to say I've encountered 
the same problem as Greg Boot. Any 
soloution/eplonation near?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/20/2002 9:53:29 AM:Jimmy Pedersen
Hi.
Doesn't seem like the Nullable 
columns has been fixed like you stated. 
This might be why: 
http://support.microsoft.com/default.asp
x?scid=KB;EN-US;Q272001&
Also it seems 
like the "default" propertie gets 
double double quotes ;-) like so: "" 
""
If you manage to solve this please 
let me know.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/21/2002 11:35:10 AM:Carl Massey
I have been using this code happyily on 
mdac2.5 but when I installed sql server 
2000 it updated my mdac to 2.6 the code 
now fails on the CAT.Tables.Append TBL 
with error 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/21/2002 11:37:19 AM:Carl Massey
Sorry I Was cut off..
"-2147217887 
/ Multiple step OLE DB operation 
generated errors. Check each OLE DB 
status value if available. No work 
was 
done" 
Can you help?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/3/2002 5:23:05 AM:Dmitry Kirsanov
Well, there are few fatal errors on 
code. And one big improvement must be 
done.
Errors:
TBL.Columns("Notes").Pro
perties("NullAble") = True -- will lead 
to error like stated in previous 
post.
Property "Seed" must not be set 
too.
The improvement required - do 
not create one long procedure. On a 
quite big database it will lead to 
procedure bigger then 65Kb and as 
result - you'll have no chance to debug 
it, VB will state "Procedure is too 
big" and refuse even to run. And when 
the compiled EXE will give you an 
error, will be hard to determine where 
it occured.
So I give this code 5 
globes, because all you need is to cut 
off some useless code and change the 
main procedure.
By the way, dont 
know how for others, for me it is much 
easier that CreateMDB procedure would 
be a function, taking as parameter the 
fully qualified filename, and return 
TRUE on success.
Have a good time.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 6:45:57 AM:Richard Gendron
Hi there, great program.
I have a 
problem when adding a Yes/No
TBL.Columns.Append "Warrenty", 
adBoolean, 2
TBL.Columns("Warrenty").Properties("Null
Able") = True
TBL.Columns("Warrenty").Properties("Desc
ription") = "Under warrenty"
I get 
an error 
-2147217887 / 
Multiple-step OLE DB operation 
generated errors.
Any solutions 
?
tks,rg
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/20/2003 5:09:50 AM:
I recently tried out your codes, it is 
great! I appreciate your 
hardwork!
But here I was having a 
little problem with AutoIncrement 
column, and have found the fix to 
it:
For AutoIncrement 
column,
Properties(
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/24/2003 10:33:11 AM:
This code is excellent!
I give you 
5!
It's a great utility.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/24/2003 10:36:40 AM:
The only thing that I have to change is 
a bit of code to replace True and False 
values because in Spanish versions of 
Access, that values are written as 
"Verdadero" and "Falso" and when 
running app, it show and variable not 
defined error.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.