Question about pulling data out of DB and putting

Results 1 to 2 of 2

Thread: Question about pulling data out of DB and putting

  1. #1
    Join Date
    Dec 1969

    Default Question about pulling data out of DB and putting

    Hi,<BR>I have been trying to find some info on taking data out of the database and putting it into a form for a couple weeks now. I am no programmer, but with the help of a friend have been able to take the information out of the form and place it into an Access database using VBscript with ASP. Here is some info on what I am in need of. I am using adobe acrobat 4.0 to create forms (i.e tax forms, etc) that can be filled out online and submitted to a database. I have accomplished this part. Now I want to be able to pull this data back out of the database and into the form. For the life of me, I have not been able to find any sample code to get me started. These past couple weeks have been quite stressful trying to figure this out. If anyone could offer any help, ideas,etc I would be greatly appreciative =-) Feel free to email me at<BR><BR>Thank you kindly,<BR>Heather

  2. #2
    Join Date
    Dec 1969

    Default RE: Question about pulling data out of DB and putt

    This is the code that you would incorporate into your form. Ask me if this isn&#039t clear and I can clarify for you.<BR>&#060;% Dim Conn, rs, SQL<BR> set Conn = Server.CreateObject("ADODB.Connection")<BR> Conn.Open "DSNName","USERID","PASSWORD" <BR>&#039UserID & Password If using SQL Server, not necessary for Access<BR> SQL = "SELECT TableFieldName FROM Tablename"<BR> set rs = Conn.Execute(SQL) %&#062;<BR>&#060;--! Here is your HTML form field where you incorporate the script to pull the records--&#062; <BR>Form Field Name Here:<BR><BR> &#060;/b&#062;&#060;/font&#062;&#060;SELECT Name="TableField" size="1"&#062;<BR> &#060;% Do While NOT rs.EOF %&#062;<BR> &#060;OPTION VALUE="&#060;%=rs("TableFieldToRetrieve")%&#062;" &#062;&#060;%=rs("TableFieldToRetrieve")%&#062;&#0 60;/option&#062;<BR> &#060;% <BR> rs.MoveNext<BR> loop<BR> %&#062;<BR> &#060;%<BR> rs.Close<BR> %&#062;<BR> &#060;/SELECT&#062; <BR>This code will pull records from a specified column in a table to populate a particular form field. I will be back here throughout the day if you have additional questions about my code. <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts