|
-
Jun 27th, 2003, 10:52 AM
#1
Thread Starter
Sleep mode
Create new database ?[Resolved]
with code ? How , where can I start off ?
Last edited by Pirate; Jun 28th, 2003 at 11:21 AM.
-
Jun 27th, 2003, 11:06 AM
#2
How about start by compacting those 3 posts into 1.
-
Jun 27th, 2003, 11:22 AM
#3
Thread Starter
Sleep mode
Originally posted by Cander
How about start by compacting those 3 posts into 1.
Each one is separate question with different solutions ? right ?
-
Jun 27th, 2003, 11:58 AM
#4
Thread Starter
Sleep mode
I did some search , I found out that I should use old ADO methods , Does this mean ADO.NET Can't do this ? Correct me if I'm wrong ! I hope so .
-
Jun 27th, 2003, 01:57 PM
#5
Lively Member
A sql Or Access database?
I can ask someone
-
Jun 27th, 2003, 01:59 PM
#6
Thread Starter
Sleep mode
MS Access Database . Thank you cgj
-
Jun 27th, 2003, 02:33 PM
#7
Frenzied Member
Do you know the structure of the database? or do you want to create it at runtime through user input?
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jun 27th, 2003, 02:35 PM
#8
Thread Starter
Sleep mode
Originally posted by Memnoch1207
Do you know the structure of the database? or do you want to create it at runtime through user input?
I don't know the structure . All what I want to do is create it at runtime . Can you help plz?
-
Jun 27th, 2003, 03:04 PM
#9
Frenzied Member
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jun 27th, 2003, 03:09 PM
#10
Lively Member
Memnoch1207 thanks
It's For Sql
-
Jun 27th, 2003, 03:11 PM
#11
Thread Starter
Sleep mode
It's for SQL unfortunately . . I should have said I'm working on MS Access . Thanks Memnoch1207 .
-
Jun 27th, 2003, 04:57 PM
#12
try this link pirate it's very good
ADO in .net explained the easy way
~
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]
-
Jun 27th, 2003, 05:31 PM
#13
Lively Member
Hi dynamic_sysop Thanks for the post
That article has nothing about creating a database from code,
-
Jun 27th, 2003, 07:48 PM
#14
Thread Starter
Sleep mode
dynamic_sysop , I appreciate your help but I really need to create new database file . I know how to do different stuff on the data though . I'm frustrated by now .
-
Jun 27th, 2003, 11:55 PM
#15
I don't think there is a .NET way to create a new Access database. If you are in a real jam you can use the ADOX COM (VB6) way or I had a workaround for ya. You could keep a completely blank Access database in a .NET resource file and extract it out at runtime to create a new database. I think you can use the SchemaTable setup that I showed you about before to add tables and fields once you get the database itself.
I'm not sure if you can add fields and tables via the Schema or not just a guess. I think you can for xml files but I'm not sure on Access databases.
Last edited by Edneeis; Jun 28th, 2003 at 12:04 AM.
-
Jun 28th, 2003, 12:02 AM
#16
Thread Starter
Sleep mode
Yeah , I thought that too . ADO.NET still leak this . Damn MS . They can't do everything perfect . . Edneeis you are really brilliant . I liked your idea . Definitely I'll try it out *but* before that what do you think of this solution :
I'll use ADOX and write that code in VB6 . Make a dll or just convert the module file to .NET . I know this is interoper. but eh . I donno .
-
Jun 28th, 2003, 12:07 AM
#17
Thread Starter
Sleep mode
and btw I can't remember SchemaTable thingy ...lol . If you can help me with the other two posts , I'll be grateful . Damn , it doesn't seem my day . Hell of bugs , errors , problems ...lol .
-
Jun 28th, 2003, 12:08 AM
#18
Using ADOX is definately easier and since .NET requires MDAC 2.7 it shouldn't be a problem you'll just need to add a reference to it in your .NET project (which creates the .NET wrapper for it). Here is how to do it with ADOX.
http://www.freevbcode.com/ShowCode.Asp?ID=3315
You don't even need to make a VB6 dll or use VB6 code. The .NET version using ADOX shouldn't be much different.
-
Jun 28th, 2003, 12:15 AM
#19
Thread Starter
Sleep mode
-
Jun 28th, 2003, 12:22 AM
#20
Yeah only 2 lines. Although I changed the link so check it again tomorrow. Good luck and good night.
-
Jun 28th, 2003, 11:20 AM
#21
Thread Starter
Sleep mode
You are VB.NET Forum leader .
-
Jun 28th, 2003, 03:58 PM
#22
Frenzied Member
You are VB.NET Forum leader .
And although i have not seen (and may never see) him in person, I really beleive he is a real nice man. I have learned a lot from him. Thanks Edneeis.
Last edited by Lunatic3; Jun 28th, 2003 at 04:01 PM.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Jun 28th, 2003, 09:58 PM
#23
Lively Member
Thanks Edneeis
Pirate I am still waiting for a reply form a .net expert,
I will post ASAP
-
Jun 28th, 2003, 10:02 PM
#24
Thread Starter
Sleep mode
Originally posted by cgj
Pirate I am still waiting for a reply form a .net expert,
I will post ASAP
Thank you cgi . That's very kind of you . I can wait
-
Jun 30th, 2003, 08:34 PM
#25
Lively Member
-
Jul 1st, 2003, 01:21 PM
#26
Thread Starter
Sleep mode
And that's what I'm using right now . It's ADOX-based . Still unmanaged code . What I really wanted is pure ADO.NET way but that's apparently for SQL Server db . Thanks anyways for the link .
-
Jul 10th, 2003, 07:15 PM
#27
Member
Tried this example and works great, but how can I add more tables in it?
I tried This, but doesn't work for some reason.
ADOXtable.Name = "Addressbook",
ADOXtable.Columns.Append("Firstname1", ADOX.DataTypeEnum.adVarWChar, 50)
ADOXtable.Columns.Append("Middlename1", ADOX.DataTypeEnum.adVarWChar, 50)
ADOXtable.Columns.Append("Lastname1",
ADOXcatalog.Tables.Append(ADOXtable)
ADOXtable.Name = "Addressbook2",
ADOXtable.Columns.Append("Firstname2", ADOX.DataTypeEnum.adVarWChar, 50)
ADOXtable.Columns.Append("Middlename2", ADOX.DataTypeEnum.adVarWChar, 50)
ADOXtable.Columns.Append("Lastname2",
ADOXcatalog.Tables.Append(ADOXtable)
ADOXtable = Nothing
ADOXindex = Nothing
ADOXcatalog = Nothing
Thanks for your help...
-
Jul 10th, 2003, 07:46 PM
#28
You should probably start a new thread, I think a lot of people aren't going to look here since it is marked as resolved. BUT it might have something to do with reuseing the same instance of the Table. Try initializing it to a New table before adding the second one.
VB Code:
ADOXtable.Name = "Addressbook",
ADOXtable.Columns.Append("Firstname1", ADOX.DataTypeEnum.adVarWChar, 50)
ADOXtable.Columns.Append("Middlename1", ADOX.DataTypeEnum.adVarWChar, 50)
ADOXtable.Columns.Append("Lastname1",
ADOXcatalog.Tables.Append(ADOXtable)
ADOXTable=New ADOX.ADOXTable
ADOXtable.Name = "Addressbook2",
ADOXtable.Columns.Append("Firstname2", ADOX.DataTypeEnum.adVarWChar, 50)
ADOXtable.Columns.Append("Middlename2", ADOX.DataTypeEnum.adVarWChar, 50)
ADOXtable.Columns.Append("Lastname2",
ADOXcatalog.Tables.Append(ADOXtable)
I didn't test this code or anything and I'm not sure what the actual object name is for the ADOX Table but you should get the idea.
-
Jul 10th, 2003, 09:14 PM
#29
Thread Starter
Sleep mode
dude , don't dig up old threads just to ask your question ...
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
|