Ask a Question related to ASP Database, Design and Development.
-
Jeremy #1
code timing out on select from access
I am getting a timeout error and I'm not sure why. I have not called
any data from a form on either post or get...(do I need to?) Any Idea
why it isn't working and how to fix it?
Thanks in advance!
Here is my entire code:
<%@LANGUAGE="JAVASCRIPT"%>
<%
var conn = Server.CreateObject("ADODB.Connection");
var rs = Server.CreateObject("ADODB.Recordset");
var sqlText = "SELECT DISTINCT Table1.*, Table2.* FROM Table2 INNER
JOIN Table1 ON Table2.Unm = Table1.Unm WHERE Table1.Field1 =
'something'";
conn.Open("DSN=photo");
rs.Open(sqlText,conn);
while (!rs.EOF) {
var f1 = rs.Fields("Field1").value;
var f2 = rs.Fields("Field2").value;
var f3 = rs.Fields("Field3").value;
}
rs.Close();
conn.Close();
Response.write (f1 + " " + f2 + " " + f3);
%>
Jeremy Guest
-
Select all checkboxes in datagrid via code
Im doing this: private function selectAll():void { var length : int = myDataGrid.dataProvider.length; for( var i : int = 0; i < length; i++ ) {... -
Use MS Access to write SQL select statements
Hello, I am not sure if this is common knowledge or not, but I just figured out how to use MS Access to write my sql select statements for me. ... -
HP Select Access
Does anyone know anything about HP's OpenView Select Access? According to HP's website, it is 'Identity management software for secure user access... -
MS Access SQL: duplicate record... ?SELECT INTO....?
What syntax would you use to dupe a record? Thanks! -- Scotter -
Access 2002 PDFWriter VBA Code w/WinXP does not work like Access 2000
I am trying to print an Access 2002 report (Windows XP OS) as a PDF. I had success with Access 2000 in a Windows 2000 environment, but as soon as I... -
Jeremy Zifchock #2
Re: code timing out on select from access
Please disregard the var in front of the sqlText string...It isn't in
the code (thus isn't what is causing the problem)
Thanks again!
*** Sent via Devdex [url]http://www.devdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Jeremy Zifchock Guest
-
Aaron [SQL Server MVP] #3
Re: code timing out on select from access
Why are you using DISTINCT? Are you really going to have a join that
produces duplicates? If so, why don't you have any primary keys?
[url]http://www.aspfaq.com/2509[/url]
[url]http://www.aspfaq.com/2504[/url]
Why are you using SELECT *?
[url]http://www.aspfaq.com/2096[/url]
Why are you using ODBC and a DSN?
[url]http://www.aspfaq.com/2126[/url]
Why are you using an explicit ADODB.Recordset object?
[url]http://www.aspfaq.com/2191[/url]
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
"Jeremy" <jeremy_zifchock@yahoo.com> wrote in message
news:f9d85033.0407120540.2e8f01ed@posting.google.c om...> I am getting a timeout error and I'm not sure why. I have not called
> any data from a form on either post or get...(do I need to?) Any Idea
> why it isn't working and how to fix it?
>
> Thanks in advance!
>
> Here is my entire code:
>
> <%@LANGUAGE="JAVASCRIPT"%>
>
> <%
>
> var conn = Server.CreateObject("ADODB.Connection");
> var rs = Server.CreateObject("ADODB.Recordset");
> var sqlText = "SELECT DISTINCT Table1.*, Table2.* FROM Table2 INNER
> JOIN Table1 ON Table2.Unm = Table1.Unm WHERE Table1.Field1 =
> 'something'";
> conn.Open("DSN=photo");
> rs.Open(sqlText,conn);
>
> while (!rs.EOF) {
> var f1 = rs.Fields("Field1").value;
> var f2 = rs.Fields("Field2").value;
> var f3 = rs.Fields("Field3").value;
> }
>
> rs.Close();
> conn.Close();
>
> Response.write (f1 + " " + f2 + " " + f3);
>
> %>
Aaron [SQL Server MVP] Guest
-
Bob Barrows [MVP] #4
Re: code timing out on select from access
Jeremy wrote:
> I am getting a timeout error and I'm not sure why. I have not called
> any data from a form on either post or get...(do I need to?) Any Idea
> why it isn't working and how to fix it?
>You have an infinite loop. You left out the rs.moveNext(); statement in your>
> while (!rs.EOF) {
> var f1 = rs.Fields("Field1").value;
> var f2 = rs.Fields("Field2").value;
> var f3 = rs.Fields("Field3").value;
> }
loop.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Jeremy Zifchock #5
Re: code timing out on select from access
Thanks Bob!
*** Sent via Devdex [url]http://www.devdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Jeremy Zifchock Guest



Reply With Quote

