If you can't explain it simply,
you don't understand it well enough.
-Albert Einstein
 
Home   News   Courses   Seminars   Templates   Help   TechHelp   Forums   Order   Contact   Logon  
 
Home > Forums > ASP
 
Active Server Pages Forum

Welcome to the ASP Forum. I love Classic ASP. My whole web site is built with that, Javascript, and of course HTML from scratch. Post your questions here. Feel free to ask about ASP.NET too. I'm not an expert (yet) but I can make my way around it, and yes, I'm brushing up my skills to I can prepare some ASP.NET lessons soon.

This forum is for everyone to read but only students (paid customers) can post here. If you'd like to become a student, you can watch ASP Beginner Level 1 for free, and then purchase Level 2 for just $1.00 here. After you create a logon, you will have full access to the Forums.

Subscribe to this forum and receive an email update whenever new posts are added. You will also be notified by email if any conversations you are involved in receieve new comments. Yes, even non-students can subscribe to update notifications.

Click Here to Post a comment and start a new discussion!

Connect to Access Database Link 
Kevin Robertson     
2 months ago
I am attempting to connect to my database using ASP.Net in Expression Web. I am using the following code:

dim conn
dim rs
conn = server.createobject("ADODB.Connection")
conn.open ("StoreDSN")
rs = server.createobject("ADODB.Recordset")
rs.activeconnection = conn
rs.open ("SELECT ProductID, ProductName FROM ProductT")
while not rs.eof
  response.write (rs("ProductName"))
  rs.movenext
end while


When I navigate to the page I get the following result:
System.__ComObject

Repeating for every record in the database. Any ideas?
Richard Rost    
2 months ago
I've never liked using DSNs. Try this instead:

DatabasePath = "/full/path/to/your/database/whatever.mdb"
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider="Microsoft.Jet.OLEDB.4.0;"
Conn.Open Server.MapPath(DatabasePath)


You shouldn't need the rs.ActiveConnection line.

And remember you don't need parentheses around statements that aren't functions and don't return a value. For example:

response.write rs("ProductName")

You don't need parens around that because you aren't returning a value from it.
Kevin Robertson    
2 months ago
Thank Richard, finally got it working. Initially ran into the same problem until I made the followong change:

response.write (rs("ProductName").Value)

Set is apparently no longer supported, so had to leave it off.
Tried without the parentheses and got on error message.
Compiler Error Message: BC30800: Method arguments must be enclosed in parentheses.

Thank you once again and keep up the great work you are doing.
Richard Rost    
2 months ago
Well that's news to me. I have done very little with ASP.NET. A few pages here and there to do specific things not supported in Classic ASP (like file uploads).
Add a Reply

Show All Comments

Post a New Comment or Question
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 
 
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search The Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

YouTube Channel    LinkedIn

Blog RSS Feed   
Keywords: asp forum active server pages  PermaLink