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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP & access problem!

Status
Not open for further replies.

pmenchaca

Programmer
Dec 27, 2006
1
US
Hi!

Im trying to get the results from a query, following is the code i use:

-------

dim con
dim rs

set con = server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.Recordset")



con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\personal\projects\dsw\RM.mdb"

dim sql

sql = "SELECT * FROM [Conference Package]"

rs.Open sql , con,adOpenForwardOnly ,adLockReadOnly

rs.Close

con.Close


------

i get the following error:



ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/dsw/Default.asp, line 17



Please note the following line in my code:


sql = "SELECT * FROM [Conference Package]"



Unfortunately, table and field names use spaces and that cannot be changed. So, is there an ADO delimiter for this kind of fields like the ones that are valid for access
[] ???

thanks in advance

 
add on to Chris's post Learn before dumping :)

[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
since using default constants why not ...

Code:
set con = server.CreateObject("ADODB.Connection")
con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\personal\projects\dsw\RM.mdb"
dim sql, con

Set rs = con.Execute("SELECT * FROM [Conference Package]")

If Not rs.EOF Then 
 Do While Not rs.EOF
  Response.Write rs("ANY_Conference Package_FIELD_NAME") & "<BR>"
 rs.MoveNext
 Loop
End If 

rs.Close
con.Close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top