473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

VB Net and ADOX

Hi.

I have an application that needs to update a database, as I'm using vb net
and an access database I have to do this using ADOX. I don't think there is
another way.

I have found all sorts of examples which are basically the same, but none of
them work!

I can create my tables and fields without any problems at all, but I want to
create an AutoNumber field. All the examples state something like,
fld.properties("Autoincrement")=true. Vb net tells me that the 'Item' is
read only, I can't find anything else that helps.

Anyone come across this? Or have an answer?

Cheers,
Tull.
Aug 18 '06 #1
8 2713
Try :

fld.Properties("AutoIncrement").Value=True

as fld.Properties("AutoIncrement") returns an object, not a boolean and you
don"t have any more non indexed default properties in VB.NET....

My personal preference would be likely to use SQL statements whenever
possible...

--
Patrice

"T Clancey" <tu**@idcodeware.co.uka écrit dans le message de news:
69********************@bt.com...
Hi.

I have an application that needs to update a database, as I'm using vb net
and an access database I have to do this using ADOX. I don't think there
is
another way.

I have found all sorts of examples which are basically the same, but none
of
them work!

I can create my tables and fields without any problems at all, but I want
to
create an AutoNumber field. All the examples state something like,
fld.properties("Autoincrement")=true. Vb net tells me that the 'Item' is
read only, I can't find anything else that helps.

Anyone come across this? Or have an answer?

Cheers,
Tull.


Aug 18 '06 #2
Would be nice, but as far as I know the Jet engine doesn't cater for table
or field updates to Access.

I'll give what you suggest a try.

Cheers,
Tull.

"Patrice" <sc****@chez.comwrote in message
news:ua**************@TK2MSFTNGP03.phx.gbl...
Try :

fld.Properties("AutoIncrement").Value=True

as fld.Properties("AutoIncrement") returns an object, not a boolean and
you don"t have any more non indexed default properties in VB.NET....

My personal preference would be likely to use SQL statements whenever
possible...

--
Patrice

"T Clancey" <tu**@idcodeware.co.uka écrit dans le message de news:
69********************@bt.com...
>Hi.

I have an application that needs to update a database, as I'm using vb
net
and an access database I have to do this using ADOX. I don't think there
is
another way.

I have found all sorts of examples which are basically the same, but none
of
them work!

I can create my tables and fields without any problems at all, but I want
to
create an AutoNumber field. All the examples state something like,
fld.properties("Autoincrement")=true. Vb net tells me that the 'Item' is
read only, I can't find anything else that helps.

Anyone come across this? Or have an answer?

Cheers,
Tull.



Aug 18 '06 #3

T Clancey napisal(a):
Hi.

I have an application that needs to update a database, as I'm using vb net
and an access database I have to do this using ADOX. I don't think there is
another way.

I have found all sorts of examples which are basically the same, but none of
them work!

I can create my tables and fields without any problems at all, but I want to
create an AutoNumber field. All the examples state something like,
fld.properties("Autoincrement")=true. Vb net tells me that the 'Item' is
read only, I can't find anything else that helps.

Anyone come across this? Or have an answer?

Cheers,
Tull.

Hi Tull,

I suggest you use ADO.NET which is data access technology recommended
to use with .NET languages. You can access databases like SQL Server,
MS Access, Oracle and many many more. You can basics of ADO.NET here:
http://tinyurl.com/q2vz6
http://tinyurl.com/nlnks
http://www.startvbdotnet.com/ado/default.aspx
http://tinyurl.com/olhsp
http://tinyurl.com/rfzym
http://msdn.microsoft.com/data/ref/adonet/default.aspx

regards,
sweet_dreams

Aug 18 '06 #4
Tull,

Here is a URL to an article that begins a 3-part series in using SQL to
manipulate Access, from Access 2000 forward. There are quite a few things you
can now accomplish with SQL, although there are still some things that
require ADOX:

http://msdn.microsoft.com/library/de.../acfundsql.asp

Kerry Moorman


"T Clancey" wrote:
Would be nice, but as far as I know the Jet engine doesn't cater for table
or field updates to Access.

I'll give what you suggest a try.

Cheers,
Tull.

"Patrice" <sc****@chez.comwrote in message
news:ua**************@TK2MSFTNGP03.phx.gbl...
Try :

fld.Properties("AutoIncrement").Value=True

as fld.Properties("AutoIncrement") returns an object, not a boolean and
you don"t have any more non indexed default properties in VB.NET....

My personal preference would be likely to use SQL statements whenever
possible...

--
Patrice

"T Clancey" <tu**@idcodeware.co.uka écrit dans le message de news:
69********************@bt.com...
Hi.

I have an application that needs to update a database, as I'm using vb
net
and an access database I have to do this using ADOX. I don't think there
is
another way.

I have found all sorts of examples which are basically the same, but none
of
them work!

I can create my tables and fields without any problems at all, but I want
to
create an AutoNumber field. All the examples state something like,
fld.properties("Autoincrement")=true. Vb net tells me that the 'Item' is
read only, I can't find anything else that helps.

Anyone come across this? Or have an answer?

Cheers,
Tull.



Aug 18 '06 #5
On Fri, 18 Aug 2006 13:04:55 +0100, "T Clancey" <tu**@idcodeware.co.ukwrote:

¤ Hi.
¤
¤ I have an application that needs to update a database, as I'm using vb net
¤ and an access database I have to do this using ADOX. I don't think there is
¤ another way.
¤
¤ I have found all sorts of examples which are basically the same, but none of
¤ them work!
¤
¤ I can create my tables and fields without any problems at all, but I want to
¤ create an AutoNumber field. All the examples state something like,
¤ fld.properties("Autoincrement")=true. Vb net tells me that the 'Item' is
¤ read only, I can't find anything else that helps.
¤
¤ Anyone come across this? Or have an answer?

ALTER TABLE TABLE_1 ADD COLUMN [ID] COUNTER
Paul
~~~~
Microsoft MVP (Visual Basic)
Aug 18 '06 #6
Hello Paul,

I'm not positive, but I believe last time I checked (admittedly a long time
ago) Jet didn't support the ALTER keyword.

To the OP: If this is an app you are giving to other people, not just something
you use yourself, then I would strongly suggest using MSDE, Sql 2005 Express
(or Pro), or the new SQL Everywhere (it's true.. SQL is even commin out my
ears).. You'll be kickin yourself as time goes on if you stick with Access.

-Boo
On Fri, 18 Aug 2006 13:04:55 +0100, "T Clancey"
<tu**@idcodeware.co.ukwrote:

¤ Hi.
¤
¤ I have an application that needs to update a database, as I'm using
vb net
¤ and an access database I have to do this using ADOX. I don't think
there is
¤ another way.
¤
¤ I have found all sorts of examples which are basically the same, but
none of
¤ them work!
¤
¤ I can create my tables and fields without any problems at all, but I
want to
¤ create an AutoNumber field. All the examples state something like,
¤ fld.properties("Autoincrement")=true. Vb net tells me that the
'Item' is
¤ read only, I can't find anything else that helps.
¤
¤ Anyone come across this? Or have an answer?
ALTER TABLE TABLE_1 ADD COLUMN [ID] COUNTER

Paul
~~~~
Microsoft MVP (Visual Basic)

Aug 19 '06 #7
Ghost,

It now supports ALTER. See my previous reply, especially the second article
in the 3-article series.

Kerry Moorman
"GhostInAK" wrote:
Hello Paul,

I'm not positive, but I believe last time I checked (admittedly a long time
ago) Jet didn't support the ALTER keyword.

To the OP: If this is an app you are giving to other people, not just something
you use yourself, then I would strongly suggest using MSDE, Sql 2005 Express
(or Pro), or the new SQL Everywhere (it's true.. SQL is even commin out my
ears).. You'll be kickin yourself as time goes on if you stick with Access.

-Boo
On Fri, 18 Aug 2006 13:04:55 +0100, "T Clancey"
<tu**@idcodeware.co.ukwrote:

¤ Hi.
¤
¤ I have an application that needs to update a database, as I'm using
vb net
¤ and an access database I have to do this using ADOX. I don't think
there is
¤ another way.
¤
¤ I have found all sorts of examples which are basically the same, but
none of
¤ them work!
¤
¤ I can create my tables and fields without any problems at all, but I
want to
¤ create an AutoNumber field. All the examples state something like,
¤ fld.properties("Autoincrement")=true. Vb net tells me that the
'Item' is
¤ read only, I can't find anything else that helps.
¤
¤ Anyone come across this? Or have an answer?
ALTER TABLE TABLE_1 ADD COLUMN [ID] COUNTER

Paul
~~~~
Microsoft MVP (Visual Basic)


Aug 19 '06 #8
On Sat, 19 Aug 2006 05:48:49 +0000 (UTC), GhostInAK <gh*******@gmail.comwrote:

¤ Hello Paul,
¤
¤ I'm not positive, but I believe last time I checked (admittedly a long time
¤ ago) Jet didn't support the ALTER keyword.
¤

Yeah, I tested it from the Access QBE before I posted. It works just fine.
Paul
~~~~
Microsoft MVP (Visual Basic)
Aug 21 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Developer98115 | last post by:
I need help getting schema information from an existing SQL Server database. My thought was that you could use ADOX via InterOp. Has anyone done this successfully and how? I have created a...
3
by: KemperR | last post by:
Hello Experts outhere, may be someone can tell me whats going wrong with my ADOX trial. I have an Access 2002 database with some tables and queries (views) The code listed below works well up...
1
by: Oliver | last post by:
Hello ! Can anyone reproduce this? I am using WinXP SP1 (MDAC 2.8) with MSVS 2003. I can create a complete database with ADOX and everything works, however if I try to add a Datatype adBoolean...
1
by: Randy | last post by:
Hello, I'm not sure if this is the correct place to post this, but I've got a C# app in which I've added a reference to the ADOX (Interop.ADOX) library and I'm using... ADOX.CatalogClass cat =...
2
by: Randy | last post by:
I am trying to relink some Oracle tables in an Access database via VB.NET and ADOX. I receive the following error when executing the cat.ActiveConnection link "Arguments are of the wrong type,...
5
by: Wayne Wengert | last post by:
I am getting an error that "object no longer valid" at the point indicated in the code below - I am trying to build a table in an Access 2000 database using ADOX. Any thoughts on what might cause...
3
by: gaffar | last post by:
Sir, Using ADOX I am developing an application in vb.net and the backend database is ms-access. i have created ms-access databse and tables and assigned primary keys to the tables through the...
1
by: Hexman | last post by:
I'm creating a new Access table using ADOX. I can add columns and indexes, but I'm baffled on how to change field properties. Can someone give me a hand? Want to change properties such as:...
3
by: Miro | last post by:
Something weird I have run into when trying to add a boolean field to an Access table by code. -Just wondering if anyone else has run into this. ( vb.net 2005 express ) If I add any other...
0
parshupooja
by: parshupooja | last post by:
Hey all, I have Arraylist where I have stored names of Tables.I have two datasources one is SQL and one is Access, they have equal number of tabels. I am trying to find Access databse column and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.