L
Fri Jul 22 13:05:03 CDT 2005
Do I have to use Recordset and arrays to accomplish this? Can you assist with
any coding or direct me to a tutorial that will assist me with this?
This is what I have so far, but I have problems with the sql statement. It
should be SELECT * FROM tblCompany WHERE ContactState =
"&txtContactState&" but I get an error message.
myconnstring = Application("VARs_ConnectionString")
set myconn = Server.CreateObject("ADODB.Connection")
myconn.Open myconnstring
set objRS = Server.CreateObject("ADODB.Recordset")
'Response.Write(myconnstring)
'
strsql = "SELECT * FROM tblCompany"
objRS.Open strsql, myconn
'
tblvalues = objRS.GetRows()
'
'For i = 1 to UBound(tblvalues,2)
For i = 1 to strcount
For j = 1 to strcount
'For j = 1 to UBound(tblvalues,1)
response.write(tblvalues(i,j) & "<br>")
Next
response.write("<p>")
Next
'
myconn.Execute mysql
myconn.Close
set myconn = Nothing
"Ronx" wrote:
> You are looping through the same fields in a form in each iteration of
> i, not through the records of a database, since the form records are
> not changing, you will get repeats.
>
> The code needs to open and read the database, then loop through the
> database records.
> --
> Ron Symonds
> Microsoft MVP (FrontPage)
> Reply only to group - emails will be deleted unread.
>
> Learn more about newsgroup questions here:
>
http://support.microsoft.com/default.aspx?scid=kb;en-us;555375
>
> "L" <L@discussions.microsoft.com> wrote in message
> news:EB85D400-C33A-4AE6-B5D3-E3086A4CA954@microsoft.com...
> > Well the reason for me using the loop was to go through the records
> > in the
> > database.
> >
> > I've modified my code (below) and it's not working:
> >
> > For i = 0 to (intcounter - 1)
> > strName(i) = Request.Form("txtRspName")
> > strCompanyName(i) = Request.Form("txtRspCompanyName")
> > strAddress(i) = Request.Form("txtRspAddress")
> > strCity(i) = Request.Form("txtRspCity")
> > strState(i) = Request.Form("txtRspState")
> > strZip(i) = Request.Form("txtRspZip")
> > strPhone(i) = Request.Form("txtRspPhone")
> > strEmail(i) = Request.Form("txtRspEmail")
> > strURL(i) = Request.Form("txtRspURL")
> >
> > Next
> >
> > strMessage = "Here is the information for the VAR in your requested
> > state:"
> > & vbCrLf & vbCrLf
> > strMessage = strMessage & "Company Name: " & strCompanyName(i) &
> > vbCrLf &
> > vbCrLf
> > strMessage = strMessage & "Name: " & strName(i) & vbCrLf & vbCrLf
> > strMessage = strMessage & "Address: " & strAddress(i) & vbCrLf &
> > vbCrLf
> > strMessage = strMessage & "City: " & strCity(i) & vbCrLf & vbCrLf
> > strMessage = strMessage & "State: " & strState(i) & vbCrLf & vbCrLf
> > strMessage = strMessage & "Zip: " & strZip(i) & vbCrLf & vbCrLf
> > strMessage = strMessage & "Phone: " & strPhone(i) & vbCrLf & vbCrLf
> > strMessage = strMessage & "Email: " & strEmail(i) & vbCrLf & vbCrLf
> > strMessage = strMessage & "URL: " & strURL(i) & vbCrLf & vbCrLf
> >
> >
> > "Jens Peter Karlsen[FP-MVP]" wrote:
> >
> >> Of course you get it twice.
> >> Here you read the same thing twice:
> >> strName(0) = Request.Form("txtRspName")
> >> strName(1) = Request.Form("txtRspName")
> >> And here:
> >> strAddress(0)= Request.Form("txtRspAddress")
> >> strAddress(1)= Request.Form("txtRspAddress")
> >> And here you write it out twice in a for loop (or however many
> >> times
> >> intcounter specifies):
> >> Response.Write(strName(i))
> >> Response.Write(strAddress(i))
> >> Now if you moved the two above lines out of the for loop it would
> >> only
> >> be written once.
> >> I can't see what you have the loop for anyway you don't use it for
> >> anything useful.
> >>
> >> Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
> >>
> >> -----Original Message-----
> >> From: L [mailto:L@discussions.microsoft.com]
> >> Posted At: 22. juli 2005 00:16
> >> Posted To: microsoft.public.frontpage.programming
> >> Conversation: View data
> >> Subject: Re: View data
> >>
> >>
> >> Well, I'm trying to. I am trying to display a record on each line
> >> instead of both records twice. Here's what I have so far:
> >> Data:
> >> Mike Santoro, Dominick Zappia33 Wood Ave. South, 5th floor, Brier
> >> Hill
> >> Ct.
> >> Building C
> >> Mike Santoro, Dominick Zappia33 Wood Ave. South, 5th floor, Brier
> >> Hill
> >> Ct.
> >> Building C
> >>
> >> Code:
> >> Dim strName(10)
> >> Dim strAddress(10)
> >> dim intcounter
> >> dim strSite
> >> dim strDomain
> >> dim strReqEmail
> >> Dim objCDO
> >> Dim objCDOResponse
> >> Dim strResponseMessage
> >> dim i
> >>
> >> 'Retreive the form input
> >>
> >> intcounter = Request.Form("intcounter")
> >> strReqEmail = Request.Form("txtRqEmail")
> >> 'strName(i) = Request.Form("txtRspName)
> >>
> >> If Trim(strReqEmail) <> "" Then
> >> '
> >> i=0
> >> For i = 0 to (intcounter - 1)
> >> strName(0) = Request.Form("txtRspName")
> >> strName(1) = Request.Form("txtRspName")
> >> strAddress(0)= Request.Form("txtRspAddress")
> >> strAddress(1)= Request.Form("txtRspAddress")
> >> 'Message sent to email address
> >> 'strMessage = strMessage & "Name: " & strName(i) &
> >> vbCrLf & vbCrLf
> >> Response.Write(strName(i))
> >> Response.Write(strAddress(i))
> >> Next
> >>
> >>
> >> "Jens Peter Karlsen[FP-MVP]" wrote:
> >>
> >> > You need to learn ASP yourself. You can buy a book or take an
> >> > online
> >> > tutorial. Look here for Tutorials:
> >> >
http://www.echoecho.com/links/Tutorials/ServerProgramming/ASP/
> >> >
> >> > Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
> >> >
> >> > -----Original Message-----
> >> > From: L [mailto:L@discussions.microsoft.com]
> >> > Posted At: 21. juli 2005 16:01
> >> > Posted To: microsoft.public.frontpage.programming
> >> > Conversation: View data
> >> > Subject: Re: View data
> >> >
> >> >
> >> > What commands will I use in Frontpage to display data from a
> >> > database?
> >> > Response.Write('') does not seem to work. Can I bind the results
> >> > to a
> >> > texbox or something?
> >> >
> >> > "Jens Peter Karlsen[FP-MVP]" wrote:
> >> >
> >> > > Absolutely. Write the necessary code yourself. That will give
> >> > > you
> >> > > full
> >> >
> >> > > control over how it looks.
> >> > >
> >> > > Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
> >> > >
> >> > > -----Original Message-----
> >> > > From: L [mailto:L@discussions.microsoft.com]
> >> > > Posted At: 21. juli 2005 00:06
> >> > > Posted To: microsoft.public.frontpage.programming
> >> > > Conversation: View data
> >> > > Subject: View data
> >> > >
> >> > >
> >> > > Is there another way to view data using Access and ASP without
> >> > > using
> >>
> >> > > the DBRW?
> >> > >
> >> > > --
> >> > > No virus found in this incoming message.
> >> > > Checked by AVG Anti-Virus.
> >> > > Version: 7.0.323 / Virus Database: 267.9.2/52 - Release Date:
> >> > > 19-07-2005
> >> > >
> >> > >
> >> >
> >> > --
> >> > No virus found in this incoming message.
> >> > Checked by AVG Anti-Virus.
> >> > Version: 7.0.323 / Virus Database: 267.9.2/53 - Release Date:
> >> > 20-07-2005
> >> >
> >> >
> >>
> >> --
> >> No virus found in this incoming message.
> >> Checked by AVG Anti-Virus.
> >> Version: 7.0.323 / Virus Database: 267.9.2/55 - Release Date:
> >> 21-07-2005
> >>
> >>
>
>
>