Click here to Skip to main content
15,891,777 members
Home / Discussions / Database
   

Database

 
AnswerRe: assigning value to variable in stored procedure Pin
RepliCrux12-Jul-07 19:05
RepliCrux12-Jul-07 19:05 
GeneralRe: assigning value to variable in stored procedure Pin
brsecu13-Jul-07 4:32
brsecu13-Jul-07 4:32 
QuestionHelp regarding moving records Pin
anu8112-Jul-07 3:31
anu8112-Jul-07 3:31 
AnswerRe: Help regarding moving records Pin
Pete O'Hanlon12-Jul-07 4:04
mvePete O'Hanlon12-Jul-07 4:04 
QuestionQuery Problem Pin
ragavan12-Jul-07 3:14
ragavan12-Jul-07 3:14 
AnswerRe: Query Problem Pin
Pete O'Hanlon12-Jul-07 3:24
mvePete O'Hanlon12-Jul-07 3:24 
AnswerRe: Query Problem Pin
TomGarth15-Jul-07 9:27
TomGarth15-Jul-07 9:27 
QuestionConnection problem Pin
matjame12-Jul-07 2:50
matjame12-Jul-07 2:50 
Hi guys.I want to establish a connection to my MS Access database using my HTML or ASP code.The problem is that I have to load database values onto the dropdownlist when I run the page but I say its the connection because the page run with no values and no dropdown.I havent been able to run any values in other examples that Ive tries.Is there configurations that I need to change in ASP or HTML to run database connections in ASP and HTML.

Here is the code I got a problem with

<%@LANGUAGE="VBSCRIPT" %>



<%
Option Explicit
Dim objConn
Dim objRS
Dim objRS2
Dim strSQL

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

objConn.ConnectionString = Server.MapPath("dropdowns.mdb")
objConn.Provider = "Microsoft.Jet.OLEDB.4.0"
objConn.Open


'-- Sub Procedure that builds the dropdown list.
'-- Parameters c, r and table are passed when the sub is built.
Sub showDropDownList(c, r, table)

'-- SQL Statement
strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC"
'-- Execute our SQL statement and store the recordset
Set r = c.Execute(strSQL)

'-- START MAIN CODE BLOCK
'-- If we have records to return
if not r.eof = false then
'-- Open a form/select tag
'-- This particular example has no action attribute, which would normally...
'-- ...be required in order to post the data to another page for processing.
Response.Write ""
Response.Write "" & vbCrLf
Response.Write "Choose...."

'-- loop and build each database entry as a selectable option
While r.EOF = false
Response.Write ""
_ & r.Fields("Title").Value & "" & vbCrLf

'-- Move recordset to the next value
r.movenext
Wend
end if
'--END OF MAIN CODE BLOCK

'-- close select/form tags
Response. Write "" & vbCrLf

End Sub

%>




<title>




Dynamic dropdown lists using Active Server Pages and Microsoft Access


Below is an example of a drop down list, dynamically populated from
a database table.




<%
' -- Call the sub procedure to build the drop down list, with the connection
and recordset objects and the source table (In quotes).
call showDropDownList(objConn, objRS, "tblDropDownTest")
%>



 


 




 






kagiso

AnswerRe: Connection problem Pin
andyharman12-Jul-07 5:52
professionalandyharman12-Jul-07 5:52 
GeneralRe: Connection problem Pin
matjame12-Jul-07 20:22
matjame12-Jul-07 20:22 
GeneralRe: Connection problem Pin
Pete O'Hanlon12-Jul-07 22:49
mvePete O'Hanlon12-Jul-07 22:49 
GeneralRe: Connection problem Pin
matjame12-Jul-07 23:09
matjame12-Jul-07 23:09 
Questioneasy join question Pin
blakey40412-Jul-07 2:43
blakey40412-Jul-07 2:43 
AnswerRe: easy join question Pin
Colin Angus Mackay12-Jul-07 2:46
Colin Angus Mackay12-Jul-07 2:46 
GeneralRe: easy join question Pin
blakey40412-Jul-07 2:48
blakey40412-Jul-07 2:48 
AnswerRe: easy join question Pin
Pete O'Hanlon12-Jul-07 2:54
mvePete O'Hanlon12-Jul-07 2:54 
GeneralRe: easy join question Pin
blakey40412-Jul-07 2:57
blakey40412-Jul-07 2:57 
AnswerRe: easy join question Pin
DQNOK12-Jul-07 8:41
professionalDQNOK12-Jul-07 8:41 
GeneralRe: easy join question Pin
blakey40413-Jul-07 0:29
blakey40413-Jul-07 0:29 
QuestionI want to Connect to MySql Server using .NET. Pin
vikasviswan12-Jul-07 2:42
vikasviswan12-Jul-07 2:42 
AnswerRe: I want to Connect to MySql Server using .NET. Pin
blakey40412-Jul-07 2:46
blakey40412-Jul-07 2:46 
QuestionProgram is blocked because of a SQL-Query on a locked table Pin
zepl12-Jul-07 2:04
zepl12-Jul-07 2:04 
AnswerRe: Program is blocked because of a SQL-Query on a locked table Pin
Paul Conrad13-Jul-07 11:47
professionalPaul Conrad13-Jul-07 11:47 
GeneralRe: Program is blocked because of a SQL-Query on a locked table Pin
zepl16-Jul-07 3:36
zepl16-Jul-07 3:36 
QuestionConvert array to a recordset in asp Pin
anilsingh1976@gmail.com12-Jul-07 1:57
anilsingh1976@gmail.com12-Jul-07 1:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.