katty Posted July 18, 2011 Share Posted July 18, 2011 Have converted Access Databank to SQL Server.After that my Recorsets are not working properly.Im using (ASP Classic).For example a simple Select * from say a table with following components:surnamevornamestreettownIf I try to call vorname before surname nothing appears but if I follow the order that the components of the table are listed then everything is fine.Can anyone explain whats going on???Thanks in advance Link to comment Share on other sites More sharing options...
katty Posted July 18, 2011 Author Share Posted July 18, 2011 Have converted Access Databank to SQL Server.After that my Recorsets are not working properly.Im using (ASP Classic).For example a simple Select * SET rsListe = Server.CreateObject("ADOdb.RecordSet")strSQL = "select * from tblAdressen "rsListe.Open strSQL, nameConn, adOpenStaticfrom say a table with following components:surnamevornamestreettownIf I try to call vorname before surname nothing appears but if I follow the order that the components of the table are listed then everything is fine.Can anyone explain whats going on???Thanks in advance Link to comment Share on other sites More sharing options...
justsomeguy Posted July 18, 2011 Share Posted July 18, 2011 Can you post the code you're using? Link to comment Share on other sites More sharing options...
katty Posted July 19, 2011 Author Share Posted July 19, 2011 Can you post the code you're using?Have discovered since yesterday that this only happens on an inner join. Here for example:SET rsListe = Server.CreateObject("ADOdb.RecordSet")strSQL = "select tblAdressen.*, tblLand.* "strSQL = strSQL&" FROM tblLand INNER JOIN tblAdressen ON tblLand.landId = tblAdressen.landId "strSQL = strSQL&" where adressenId="&intAdressenIdrsListe.Open strSQL, nameConn,adOpenStaticHere is the order of the fields in the table. intType= rsListe("Type")strfirma1= rsListe("firma1")strFirma2= rsListe("Firma2")strNachname= rsListe("Nachname")strBranche= rsListe("Branche")intKundenNr= rsListe("KundenNr")intZaehler= rsListe("Zaehler")strKunde= rsListe("Kunde")strWerkstatt= rsListe("Werkstatt")strBieter= rsListe("Bieter")strVersicherung= rsListe("Versicherung")strRechtsanwalt= rsListe("Rechtsanwalt")strAktiv= rsListe("Aktiv")strTyp= rsListe("Typ")strAnrede= rsListe("Anrede")strVorname= rsListe("Vorname")strStrasse1= rsListe("Strasse1")strStrasse2= rsListe("Strasse2")strPlz= rsListe("Plz")strOrt= rsListe("Ort")strTelPriv= rsListe("TelPriv")strTelGes= rsListe("TelGes")strFax= rsListe("Fax")strHandy= rsListe("Handy")strEmail= rsListe("Email")strBemerkung= rsListe("Bemerkung")strSteuer= rsListe("Steuer")intLand= rsListe("LandId")strLand= rsListe("land")response.write strLand & "strland<br>"response.write intLandId & "intland<br>"<%while not rsListe.eof %><%=strFirma1%><%=strFirma2%><%rsListe.MoveNextwend%>As soon as I swap strFirma1 for strFirma2 then strFirma1 is nowhere to be seen. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 19, 2011 Share Posted July 19, 2011 If that is your complete code, then you're not getting the values in the loop. You're getting the values for the first row only, then looping and printing out those same values every time. You should be updating the values in the loop. It's also better to use this syntax to get the value of a field:rs.fields.item("field_name").value Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.