nazar Posted February 17, 2006 Share Posted February 17, 2006 hello once again i ned to know how can i having a loop in a SQL query using asp:maybe like sql= insert into() value(loop) Link to comment Share on other sites More sharing options...
Akasha Posted February 21, 2006 Share Posted February 21, 2006 maxcounter stands for how many times you want to repeat the query set conn2=Server.CreateObject("ADODB.Connection")conn2.Provider="Microsoft.Jet.OLEDB.4.0"conn2.Open "Provider=SQLOLEDB; Data Source = ......"For i = 0 to maxcounter sql = "INSERT INTO [I]naamtables [/I]VALUES ([I]'Values"'[/I])" conn2.Execute(sql)Next for your sql query you can use dynamical variables to change the queriefor example sql2 = "INSERT INTO Simulatie_auteur VALUES ('"&request.form("titel") & "', '" & memberarray(i) & "')" the titel stays the same, but the memberarray(i) changes as long maxcounter hasn't been reachedi hope this wil help you on your way Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now