|
-
Aug 9th, 2003, 11:07 PM
#1
Thread Starter
Fanatic Member
Create a database...How to get started?
Hello,
I am a bit of a newbie and am looking for the basics of how to get started creating a database. I just would like to hear from the experts and experience folks on their opinions and experiences. What works best? What is the initial things to do? In other words, just plain ole good advice.
The project I am thinking of doing involves pretty much the usual....Entering data in and querying.
Thanks!
-
Aug 10th, 2003, 02:56 AM
#2
Sleep mode
How do you want to create the new database by code or just using UI in Access ?
-
Aug 10th, 2003, 07:16 AM
#3
Thread Starter
Fanatic Member
VB
I want to create it using code in VB.NET.
-
Aug 10th, 2003, 09:50 AM
#4
Sleep mode
Apparently , there is no pure .NET code that can create new MS Access database from scratch . Here is a way that can be possible to do in VB.NET .It's interop. though , it's working fine . http://www.vbforums.com/showthread.p...e+new+database
-
Aug 10th, 2003, 10:11 AM
#5
you can create it without a reference , going along the lines of what Pirate created, but using Objects....
VB Code:
[COLOR=BLUE]Dim[/COLOR] obCat [COLOR=BLUE]As Object[/COLOR] = [color=blue]CreateObject[/color]("ADOX.Catalog")
[COLOR=BLUE]Dim[/COLOR] objTab [COLOR=BLUE]As[/COLOR] [COLOR=BLUE]Object[/COLOR] = [COLOR=BLUE]CreateObject[/color]("ADOX.Table")
[COLOR=BLUE]Dim[/COLOR] objInd [COLOR=BLUE]As[/COLOR] [COLOR=BLUE]Object[/COLOR] = [COLOR=BLUE]CreateObject[/color]("ADOX.Index")
[COLOR=BLUE]Try
[/COLOR] obCat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:\My.mdb")
obCat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\My.mdb"
[COLOR=BLUE]With[/COLOR] objTab
.Name = "Table1"
.Columns.Append("NAME", ADOX.DataTypeEnum.adVarWChar, 40)
.Columns.Append("ADDRESS", ADOX.DataTypeEnum.adVarWChar, 20)
.Columns.Append("ID", ADOX.DataTypeEnum.adInteger)
obCat.Tables.Append(objTab)
.Indexes.Append(objInd)
[COLOR=BLUE]End[/COLOR] [COLOR=BLUE]With
[/COLOR] [COLOR=BLUE]Catch[/COLOR] ex [COLOR=BLUE]As[/COLOR] Exception
MessageBox.Show(ex.Message)
[COLOR=BLUE]End[/COLOR] [COLOR=BLUE]Try[/COLOR]
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Aug 10th, 2003, 10:19 AM
#6
Sleep mode
The initial variables in my thread are objects as well .
-
Aug 10th, 2003, 10:35 AM
#7
i only saw this....
'a reference to ADOX (Microsoft ADO Ext. 2.x for DDL and Security)
Dim ADOXcatalog As New ADOX.Catalog
Dim ADOXtable As New ADOX.Table
Dim ADOXindex As New ADOX.Index
seems to be needing a reference to the ADOX library that way, just showing a way to do it without a reference ( ie: through vb code ) like this...
Dim obCat As Object = CreateObject("ADOX.Catalog")
Dim objTab As Object = CreateObject("ADOX.Table")
Dim objInd As Object = CreateObject("ADOX.Index")
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Aug 10th, 2003, 10:40 AM
#8
Sleep mode
CreateObject is just like New method . And actually you are referring (early-binding) the variables ADOX.blah to the newly created obj .
-
Aug 10th, 2003, 12:17 PM
#9
Thread Starter
Fanatic Member
Access
Thanks......
So.......is it common place to use Microsoft Access as the database? Just for the sake of discussion, are there other ways other than Access?
-
Aug 10th, 2003, 01:27 PM
#10
Sleep mode
Access is common because it's easier , common , easy when distributing your app ...etc . Yes , there are other Databases you can use . One of them is SQL Server database 2000 , Oracle , MySQL , FoxPro ..etc . If you want how to create new SQL Database from scratch , I can give you the link .
-
Aug 10th, 2003, 03:49 PM
#11
Thread Starter
Fanatic Member
Great!
Yes please, I would like to explore all the options.
Thanks!
-
Aug 10th, 2003, 05:05 PM
#12
Sleep mode
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|