2 messages in com.mysql.lists.win32Re: ASP & MySql
FromSent OnAttachments
Jörg Grote19 Oct 2000 14:21 
Christopher R. Jones19 Oct 2000 15:38 
Subject:Re: ASP & MySql
From:Christopher R. Jones (cj@interlog.com)
Date:10/19/2000 03:38:51 PM
List:com.mysql.lists.win32

You need to use the recordset "execute" method to insert and update.

Hello Where, I want to write and read Data, with an JavaScript NT-ASP in IIS5 from an mySQL Database, over myODBC.

The Reading works, but the Insert and Update not, why.

here my Example Script: (AddNew() works but rsTemp("Name") not)

<% @Language = "JScript" %> <%Response.Buffer = true function getDBconnection() { var x = Application("dbstring"); x = x + ""; x = "DSN=mysql;UID=root;PWD=" ; return x; } %> <!--#include file="funcinc/dbFunc.asp"--> <OBJECT RUNAT=Server ID=cn PROGID="ADODB.Connection"></OBJECT> <% Response.write("<br>"); var x = getDBconnection(); var lngRecsAffected; var rsTemp = Server.CreateObject("ADODB.Recordset"); sqlselect = "SELECT * from benutzer"; rsTemp.CursorType = 3; rsTemp.LockType = 3;

if (cn.State == adStateClosed) cn.Open(x); rsTemp.Open(sqlselect,cn); Response.write("<br>"); if ((rsTemp.BOF != true) && (rsTemp.EOF != true)) // --- works !!!! { rsTemp.MoveFirst(); n=-1 while ((rsTemp.BOF != true) && (rsTemp.EOF != true)) { n++ Response.write("<br>"); Response.write("<:personal" + n + " = " + killspaceright(rsTemp("name").value) + " :>"); Response.write("<:pass" + n + " = " +
killspaceright(rsTemp("ort").value) + " :>"); rsTemp.MoveNext(); } // end while } // end if

rsTemp.AddNew(); // --- Problem here !!! rsTemp("Name")= "Test99"; rsTemp("Ort") = "Test99"; rsTemp.Update();

rsTemp.Close(); %>

Thanks for your Help

Jörg Web: www.grote-online.de

To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail win3@lists.mysql.com instead.