Wrox Programmer Forums
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 22nd, 2004, 04:01 PM
Registered User
 
Join Date: Jul 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help Help Help

This is one of those 4-hour problems. Here is what is happening - the code executes just fine, it goes through the Do-While loop just fine, it generates the correct UPDATE statements just fine, BUT, it only executes the UPDATE statement the first time through and updates the first record only. WHY? The code snippet is below:

X = 0
LANGUAGE = Request("LANGUAGE")
TID = Split(Request("TRANS"),",")
EID = Split(Request("ENG"),",")
UPPER = Ubound(TID)
Set Conn = Server.CreateObject("ADODB.Command")
Conn.ActiveConnection = "DSN=xxxxxx;UID=;pwd=;"
Do Until X > UPPER
'---------- COMMIT CHANGES TO THE DATABASE -----------
Conn.CommandText = "UPDATE Translations SET Translation='" & Replace(TID(X),"'","#39;") & "' WHERE LANGID='" & LANGUAGE & "' AND English='" & EID(X) & "'"
Conn.Execute
X = X + 1
Loop
Conn.ActiveConnection.Close
Response.Write X & " records committed"

The more I learn, the less I know.
 
Old September 27th, 2004, 11:36 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I hate to provide a useless response... but...

Why are you using ADODB objects in .NET?? Let's start with that issue. You need to read a tutorial on ADO.NET and all the glorious data access classes.









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.