Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access ODBC

Status
Not open for further replies.

arlequin

Programmer
Sep 21, 1999
232
0
0
UY
Hi people!!

I know I can work with MS ACCESS from ASP databases using the ODBC or using the name and the path of the MDB file.

How can I work with the ADODB.Connection object properties?



Many Thanks!!! Arlequín
arlequin@montevideo.com.uy
 
The way I use ADO is:

Dim rec as adodb.Recordset
dim con as adodb.connection

set rec = New adodb.recordset
set con = New adodb.connection

rec.cursorLocation = adUseClient
con.connectionstring = &quot;PROVIDER=MSDASQL;dsn=<MyDSN>;uid=sa;pwd=&quot; (this is if your are using SQL Server, an mdb provider would be &quot;Provider=Microsoft.Jet.OLEDB.4.0&quot;)

con.open
rec.open &quot;MyTable&quot;, con

set MYform.Recordset = rec
rec.close
con.close

This is the most effective way of doing it, I've found. One thing though, with excessively large SQL statements the Recordset property can return an error that states &quot;The setting for this property is too long&quot; (Run-time error 2176). But, anyway this should help you out.

Bob
 
Bob,
Obviously you posted this quite a long time ago and I don't know if you are still checking this but I ran into a problem.

I have a listbox in which users can select records to be pushed into a report. The selections can get long and it seems that they produce the run-time error you mentioned (&quot;2176&quot;).

Do you have any suggestions on how to work around this or fix it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top