Home All Groups Group Topic Archive Search About
Author
18 Aug 2006 12:04 PM
T Clancey
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.

Author
18 Aug 2006 12:21 PM
Patrice
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" <t***@idcodeware.co.uk> a écrit dans le message de news:
69KdnQp_6KZWMXjZRVn***@bt.com...
Show quoteHide quote
> 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.
>
>
Author
18 Aug 2006 12:52 PM
T Clancey
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.

Show quoteHide quote
"Patrice" <scr***@chez.com> wrote in message
news:uamGUDswGHA.2260@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" <t***@idcodeware.co.uk> a écrit dans le message de news:
> 69KdnQp_6KZWMXjZRVn***@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.
>>
>>
>
>
Author
18 Aug 2006 1:14 PM
Kerry Moorman
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/default.asp?url=/library/en-us/dnacc2k/html/acfundsql.asp

Kerry Moorman




Show quoteHide quote
"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" <scr***@chez.com> wrote in message
> news:uamGUDswGHA.2260@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" <t***@idcodeware.co.uk> a écrit dans le message de news:
> > 69KdnQp_6KZWMXjZRVn***@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.
> >>
> >>
> >
> >
>
>
>
Author
18 Aug 2006 1:06 PM
sweet_dreams
T Clancey napisal(a):
Show quoteHide quote
> 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
Author
18 Aug 2006 5:27 PM
Paul Clement
On Fri, 18 Aug 2006 13:04:55 +0100, "T Clancey" <t***@idcodeware.co.uk> wrote:

¤ 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)
Author
19 Aug 2006 5:48 AM
GhostInAK
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

Show quoteHide quote
> On Fri, 18 Aug 2006 13:04:55 +0100, "T Clancey"
> <t***@idcodeware.co.uk> wrote:
>
> ¤ 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)
Author
19 Aug 2006 3:49 PM
Kerry Moorman
Ghost,

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

Kerry Moorman


Show quoteHide quote
"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"
> > <t***@idcodeware.co.uk> wrote:
> >
> > ¤ 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)
>
>
>
Author
21 Aug 2006 6:42 PM
Paul Clement
On Sat, 19 Aug 2006 05:48:49 +0000 (UTC), GhostInAK <ghosti***@gmail.com> 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. 
¤

Yeah, I tested it from the Access QBE before I posted. It works just fine.


Paul
~~~~
Microsoft MVP (Visual Basic)