Populate Dynamic DropDown

I wanted to dynamically populate a drop down box.. I found this code on the net and tried to edit it but apparently it doesnt work. I get an error in IE:

"Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/iishelp/iis/htm/tutorial/sim.asp, line 39, column 78
objConn.Open "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & strDBLocation"

Can someone help me with this code or specify a place where i can find help
help wil be appreciated..

Option Explicit

 Dim objConn
 Dim objRS
 Dim strSQL
 Dim appID
 Dim appName
 Const adOpenForwardOnly = 0
 Const adLockReadOnly  = 1
 strDBVirtualPath = "/iishelp/iis/htm/tutorial/Simulation.mdb"
 strDBLocation = Server.Mappath(strDBVirtualPath)

 Set objConn = Server.CreateObject("ADODB.Connection")
 Set objRS  = Server.CreateObject("ADODB.Recordset")

 objConn.Open "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & strDBLocation"

 strSQL = "SELECT Application_ID, Application FROM Application"
 objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly
 Response.Write "<SELECT Name=""AppID"">"
 Response.Write "<OPTION Value=""""></OPTION>"
 ' Loop through the recordset and populate the dropdown
 Do Until objRS.EOF = True
  AppID  = objRS("AppID").Value
  UserName = objRS("Application").Value

   Response.Write "<OPTION Value=""" & AppID & """>"
   Response.Write Application
   Response.Write "</OPTION>"
 Response.Write "</SELECT>"
 Set objRS = Nothing
 Set objConn = Nothing
Who is Participating?
dfu23Connect With a Mentor Commented:
kill the last double quote on that line, like this:

objConn.Open "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & strDBLocation
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.