All I want is to create a table that's it ...

Doron Barnea

Member
Joined
May 31, 2005
Messages
9
Programming Experience
10+
ADOX enum ain't working

Why can't I define adBig Int or other types when creating a table ???

adInteger works ..

I get invalid type ...

Dim ADOXtable As New ADOX.Table

'name table, append fields to table

ADOXtable.Name = "bla"

ADOXtable.Columns.Append("sort", ADOX.DataTypeEnum.adBigInt) --> NOT WORKING

ADOXtable.Columns.Append("value", ADOX.DataTypeEnum.adChar, 50) --> NOT WORKING

ADOXtable.Columns.Append("sort", ADOX.DataTypeEnum.adInteger) --> WORKING

' Cat is ok ...
Cat.Tables.Append(ADOXtable)

 
From your description, I understand that you need to create a table in certain DB using ADOX. If it's not please feel free to let me know.
btw, in vb.NET using of ADOX is not very good idea. :(
Otherwise, i would suggest another approach for Creating a DataTable in Code, but first let me know what is your idea ...

waiting for your feedback ... Cheers ;)
 
yes ..

Well , I first need to create a new mdb file. From what I know the only way to do this is using ADOX.

Then I want to create a table and indexes and add some rows.

I know I can just "CREATE TABLE .... " sing OleDBCommand but I rather not to.

I tried messing around with table.Columns.add and stuff but I miss something .

so , how can I do it ?
 
I'm going through hell trying to create a new access database with one table in it.

I have tried each and every code example I ran into. ADOX , ADO , ADO.NET , you name it. Nothing is working. Each sample with it's own problems.

Can anyone please write the minimal code needed to create a new mdb file and in it a table with one integer column and one string column ?

I am desperate.
 
Well, sorry for the delay. I was very bussy with deploying up a current project ... :(

So, create a Ms Access DB using ADOX is probably easiest part of DB programming and you'll be assured from attachment below. Btw, i thought you could use Stream Class for the same ... i think it's much better ....

Dim Savefile As New IO.FileStream("C:\NewDB.mdb", IO.FileMode.Create) ///*

Ok, i will try to make a demo with this class but i cannot promise ... as i told you i'm bussy these days (pending work) but i'll try anyway ... Cheers ;)

Take a look at the attached project !
 

Attachments

  • CreateDBUsingADOX.zip
    40.5 KB · Views: 57
Back
Top