> Hi!
>
> I am making a simple web page that adds e-mail adress to a very simple
> database to have a newsletter on my site. When I use that page for the
> first time it works really well and the data is added to the access
> database. But if I ever try to add more data, I get this error :
> Active Server Pages, ASP 0113 (0x80004005)
> The maximum amount of time for a script to execute..........
>
> I really don't know what is the problem since I run that script on my
own
> computer. The problem cannot be related to a speed or time question, but
> more an error I must have made. But what is it?
>
> Here is the complete code (I know it is not really good code but I'll
make
> it better by the time I get it to work fine...)
>
> ' This page is opened by an html e-mail so that is why I use
QuerySting...
> Dim strEmail, strType, strLanguage
> strEmail= Trim(Request.QueryString("email")) ' Trimmed in case the user
> accidentally added spaces
> strType= Trim(Request.QueryString("type"))
> strLanguage= Trim(Request.QueryString("lang"))
>
> CONST SELECT_NEWS= "SELECT NEWS.NEWS_EMAIL, NEWS.NEWS_TYPE,
> NEWS.NEWS_LANGUAGE FROM NEWS;"
>
> Dim siteConn
> Set siteConn= Server.CreateObject("ADODB.Connection")
> siteConn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" &
> Server.MapPath("Data\site.mdb")
>
> ' Create the command and put SQL query in it
> Dim objCommand
> Set objCommand= Server.CreateObject("ADODB.Command")
> objCommand.ActiveConnection= siteConn
> objCommand.CommandText= SELECT_NEWS
> objCommand.CommandType= adCmdText
>
> ' Create the record set and execute the SQL query
> Dim objRS
> Set objRS= objCommand.Execute
>
> Dim emailExists
> emailExists= False
>
> While Not objRS.EOF AND Not emailExists
> If objRS("NEWS_EMAIL") = strEmail Then
> emailExists= True
> End If
> Wend
>
> objRS.Close
> Set objRS= Nothing
> Set objCommand= Nothing
>
> If Not emailExists Then
> CONST INSERT_NEWS= "INSERT INTO NEWS VALUES ("
>
> ' Create the command and put SQL query in it
> Dim objCommand2
> Set objCommand2= Server.CreateObject("ADODB.Command")
> objCommand2.ActiveConnection= siteConn
> objCommand2.CommandText= INSERT_NEWS & "'" & strEmail & "', '" &
> strType & "', '" & strLanguage & "')"
> objCommand2.CommandType= adCmdText
> objCommand2.Execute
>
> Set objCommand2= Nothing
> End If
>
> siteConn.Close
> Set siteConn= Nothing
> ' End of script...
>
> Thanks!
> Matt.
Hi Matt,
I've done this a million times. You're missing objRS.MoveNext in your
while loop.
Jeff