|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB Net and ADOXHi.
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. 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. > > 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. >> >> > > 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. > >> > >> > > > > > > > T Clancey napisal(a):
Show quoteHide quote > Hi. Hi Tull,> > 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. 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 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) 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) 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) > > > 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)
DateTime conversion to Integer
Detecting if a printer is connected to the PC Component UI CAB Architecture Guide??? For Dummies Book? :-) SqlDataAdapter.FillSchema Redrawing a part of a control What to do when GetDeviceCaps doesn't? Datagrid relationships Math question: Based on excel Send SMS from PC through fixed land line VB6: send active hyperlink in body of email sent in VB6 |
|||||||||||||||||||||||