473,837 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2736
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**@idcodewar e.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.co mwrote in message
news:ua******** ******@TK2MSFTN GP03.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**@idcodewar e.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.co mwrote in message
news:ua******** ******@TK2MSFTN GP03.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**@idcodewar e.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**@idcodewar e.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**@idcodewar e.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**@idcodewar e.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*******@gmai l.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
5573
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 Interop reference to the ADOX COM component from my C# project. I am able to open the SqlConnection successfully but it fails with an exception when I try to set the ..ActiveConnection property of the ADOX database catalog object. Another strange...
3
10192
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 to the point where I want to add the new view to the views collection. I get Runtime error 3001 which is telling me "Arguments are of wrong type,are out of acceptable range or conflict with one another"
1
4581
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 the program raises an exception without any information :( I am adding all of the columns the same way, its only the boolean type which gives the problems:
1
3073
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 = new ADOX.CatalogClass(); cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + path + ";" + "Jet OLEDB:Engine Type=5");
2
7854
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, are out of acceptable range, or are in conflict with one another. Here is my code Dim cat As ADOX.Catalog = New ADOX.Catalo Dim tbl As ADOX.Tabl Dim OracleConn As String = "Provider=MSDAORA.1;Data Source=xzy;User ID=xyz;Password=xyz
5
2086
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 this? ==================== code ================= Sub CreateADOUnitsTable(ByVal sTablename As String) Dim oDB As ADOX.Catalog Dim oUnits As ADOX.Table
3
1718
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 vb.net application(code is below) by using ADOX. Now my problem is i want delete one record from master table, that deleted record automatically deleted from child tables. so, i want the code how to establish relation ships between the tables and...
1
11605
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: Description (Column property?), Decimal Places, Caption, Default value, Required indicator, Format, etc.... TIA,
3
3575
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 field other than boolean the "command" version of adding a field works great. But if I try to add a boolean field, I get an exception error when its trying to be added, so instead I have to use the function meathod. -Code is below.
0
1140
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 datatypes matches to Sql columns and their datatypes not. I am using Adox and unable to understand what shd I do next. here is code adn throws error on bold 'column' place Error Cannot convert type 'char' to 'ADOX.Columns' private void...
0
9843
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
10881
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10628
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10275
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7807
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Duprť who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7004
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5670
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4475
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3126
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.