Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2003, 01:24 PM
Authorized User
 
Join Date: Sep 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default form input as database name

I have a form where user enters user name and then I want to open the database corresponding to the user name.
I am writing the following code :
<%
   Dim objConn, objRS, strQuery,objDC,strConnection,uid,strPath
 uid=Request.form("uid")
Set objConn = Server.CreateObject("ADODB.Connection")
strPath= "\" & "& uid &" & ".mdb;"
strConnection= "Driver={Microsoft Access Driver (*.mdb)};" & _
              "Dbq=" & Server.MapPath(".") & strPath
objConn.Open strConnection

strQuery = "SELECT research_interest from tblresearch"

Set objRS = objConn.Execute (strQuery)

%>

I am getting thr follwing error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x22c Thread 0x4b8 DBC 0x2077fc4 Jet'.
PLEASE HELP!!

 
Old October 21st, 2003, 03:12 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You pass uid as a string, not as the value of a variable:

strPath= "\" & "& uid &" & ".mdb;"

should be:

strPath= "\" & uid & ".mdb;"

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie: Input Form Problem kwilliams ASP.NET 2.0 Professional 1 June 12th, 2008 08:15 AM
Need HELP with: Formated Input form file LoonyGenius C++ Programming 3 December 25th, 2006 06:43 PM
change the form input value maggiefeng Classic ASP Basics 2 December 10th, 2006 10:28 AM
input form ( onclick) bubblegirl Javascript How-To 1 March 6th, 2006 01:48 AM
submitting a form have an input File alyeng2000 Classic ASP Basics 6 November 1st, 2003 09:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.