Ask a Question related to ASP Database, Design and Development.
-
Neven Klofutar #1
Access - retriving primary key ...
Hi,
I'm trying to get a primary key from a table via openSchema method, but it
seems that I can do that on Access DB.
I only get a error:
"ADODB.Connection (0x800A0CB3)
Object or provider is not capable of performing requested operation."
Code:
**************************
set rs = Server.CreateObject("ADODB.Recordset")
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnString
Set rs = Conn.OpenSchema(adSchemaPrimaryKeys)
for each element in rs.fields
Response.Write element & "<br>"
next
rs.Close: set rs = nothing
Conn.Close: set Conn = nothing
Neven Klofutar Guest
-
Primary Scratch & Windows Primary Paging file?
Okay, I accidentally uninstalled Adobe Photoshop the other day. So I re-installed it and now when I click on the Photoshop Icon and it starts to... -
Storing and Retriving Data Locally
Hello, I have been asked to write a program using flash in which the user will input data. I need to save and store this data locally to the... -
setting and retriving the correct text member height!
how can i set and retrieve the correct height and width of a cast member? a lot of times I means tnx -
Putting/retriving files into a database
Hello, its been a while since I posted/looked here... my normal email client doesn't handle newsgroups :( (ximian evolution) I was wondering how... -
Access the primary key while inserting a record
Is there a way to reference the 'primary key' field of a record you are actually inserting at the moment. Im using an 'int auto increment' field... -
Bob Barrows #2
Re: Access - retriving primary key ...
Two options, neither of which I've tried (I always seem to know which field
is the primary key in the tables i've designed for some reason <wink>)
1. Open a recordset on the table using a sql statement with "WHERE 1=2" so
you get an empty recordset. Then loop through the Fields collection,
checking the Attributes property until you find the dey field(s).
2. Use ADOX.
HTH,
Bob Barrows
Neven Klofutar wrote:> Hi,
>
> I'm trying to get a primary key from a table via openSchema method,
> but it seems that I can do that on Access DB.
> I only get a error:
> "ADODB.Connection (0x800A0CB3)
> Object or provider is not capable of performing requested operation."
>
> Code:
> **************************
> set rs = Server.CreateObject("ADODB.Recordset")
> set Conn = Server.CreateObject("ADODB.Connection")
> Conn.Open ConnString
>
> Set rs = Conn.OpenSchema(adSchemaPrimaryKeys)
>
> for each element in rs.fields
> Response.Write element & "<br>"
> next
>
>
> rs.Close: set rs = nothing
> Conn.Close: set Conn = nothing
Bob Barrows Guest



Reply With Quote

