Ahhh..sorry...Forget it...jeg fandt min 'lille' fejl...
Brian
"Brian H. Madsen" <bmadsen@iinet.com.au> wrote in message
news:3b4fbbe5$0$20734@echo-01.iinet.net.au...
> hey.
>
> Jeg har lige et par problemer med en UPDATE query til en Access 2000
> database og haaber der er en eller anden her some kan hjaelpe mig ud.
>
> Der er sikkert mange andre maader at goere dette her paa men der er en
> 'logisk' grund til at jeg goer det paa denne meget 'langsomme' maade. Det
er
> en langsom maade at opdaterer en database paa men jeg aendrer SQL senere.
>
> Jeg har proevet to forskellige maader at sende SQL'et paa, men det giver
mig
> den samme fejl besked.
>
> Okajse, saa proever vi....
>
> <%
> strCounter = Request.form("Counter")
>
> DBPath = Server.MapPath( "AccessCheck1.mdb" )
> Set Con = Server.CreateObject( "ADODB.Connection" )
> Con.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & DBPath
>
> 'strCounter = 10
> y = 1
> x = 0
>
> Do Until x = strCounter
> strFirstName = Request.Form("FirstName" & y)
> strSurname = Request.Form("Surname" & y)
> strUsername = Request.form("Username" & y)
> strPassword = Request.form("Password" & y)
> strEmailAddress = Request.form("EmailAddress" & y)
> strLevel = Request.form("Level" & y)
> strID = Request.form("tblID" & y)
>
> 'response.write(strFirstName)
> 'response.write(strID)
>
> strSQLQuery = "Update tblAccount Set FirstName = '" & strFirstName & "'
> Where tblID = " & strID & ";"
> Con.Execute strSQLQuery, 1
> 'Set rs = Server.CreateObject("ADODB.Recordset")
> ' rs.Open strSQLQuery, Con, 3, 3
>
> strSQLQuery = "Update tblAccount Set Surname = '" & strSurname & "' Where
> tblID = " & strID & ";"
> Con.Execute strSQLQuery, 1
> 'Set rs = Server.CreateObject("ADODB.Recordset")
> ' rs.Open strSQLQuery, Con, 3, 3
>
> strSQLQuery = "Update tblAccount Set Username = " & strUsername & "' Where
> tblID = " & strID & ";"
> Response.write(strSQLQuery)
> Con.Execute strSQLQuery, 1
> 'Set rs = Server.CreateObject("ADODB.Recordset")
> ' rs.Open strSQLQuery, Con, 3, 3
>
> strSQLQuery = "Update tblAccount Set Password = '" & strPassword & "'
Where
> tblID = " & strID & ";"
> Con.Execute strSQLQuery, 1
> 'Set rs = Server.CreateObject("ADODB.Recordset")
> ' rs.Open strSQLQuery, Con, 3, 3
>
> strSQLQuery = "Update tblAccount Set EmailAddress = '" & strEmailAddress &
> "' Where tblID = " & strID & ";"
> Con.Execute strSQLQuery, 1
> 'Set rs = Server.CreateObject("ADODB.Recordset")
> ' rs.Open strSQLQuery, Con, 3, 3
>
> strSQLQuery = "Update tblAccount Set Level1 = '" & strLevel & "' Where
tblID
> = " & strID & ";"
> Con.Execute strSQLQuery, 1
> 'Set rs = Server.CreateObject("ADODB.Recordset")
> ' rs.Open strSQLQuery, Con, 3, 3
>
> 'strFirstName1 = strFirstName & y
> 'Response.write(strFirstName)
> 'Response.write"<BR>"
> x = x + 1
> y = y + 1
> Loop
>
> Con.close
> Set Con = Nothing
>
> Response.redirect("account_admin.asp")
>
> %>
>
> Ok, og saa fejl beskeden....
>
> Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
>
> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator)
in
> query expression 'tblID ='.
>
> /Mt-Magnet/test/account_insert.asp, line 25
>
>
> Det er hvad der gaar galt...Saa vidt jeg kan se, saa skulle det virke..
>
> Lidt database info :
>
> tblID = Autonumber/PrimaryKey
>
> Ms Access 2000
>
> ....Jeg haaber der er nogen her som kan finde mit problem....
>
> Paa forhaand tak.
>
> Brian
>
>