Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

hallo,

bei folgendem Code bekomme ich nicht die Ergebnisse, die ich möchte. Und zwar, wenn man ein "radio" button auswählt, z.B. Produkt, sollte meine Tabelle beim Klicken auf "Abschicken" sortiert nach der Spalte Produkt angezeigt werden, genauso wenn man "Produkt_id" auswählt, sollte meine Tabelle nach der Produkt_id angezeigt werden. Was tue ich falsch hier, hätte jemand eine Idee?

<form name="form1" action="/datenbank/Radio.asp" method="post">

<table border="1">

<tr>

<td><input type="radio" name="RadioKnopf" value="1" checked>Produkt</td>

<td><input type="radio" name="RadioKnopf" value="2">Produkt_id</td>

</tr>

<tr><td><input type="button" name="Senden" value="Abschicken"></td></tr>

</table>

</form>

<%

On Error Goto 0

Dim strSort

Dim objConn

Dim objCmd

Dim objRS

Dim strConn

Dim SQLquery

Dim strDB

strDB = "Data Source=" &_

Server.MapPath("../datenbank/db1.mdb")

Set objRS = server.CreateObject("ADODB.Recordset")

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & strDB

strSort = Request("RadioKnopf")

SQLquery = "SELECT *" & _

"FROM LU_Produkt ORDER BY '" & strSort & "'"

objRS.Open SQLquery,strConn

Set objConn = CreateObject("ADODB.Connection")

objConn.ConnectionString = strConn

objConn.Open()

Set objCmd = CreateObject("ADODB.Command")

Set objCmd.ActiveConnection = objConn

objCmd.CommandText = SQLquery

Set objRS = objCmd.Execute

%>

<%

Dim intCurrent

Dim strBgColor

intCurrent = 0

While Not objRS.EOF And Response.IsClientConnected

strBgColor = "#f5f5ff"

%>

<table align=center width="70%">

<td align=center width=10% ><%= objRS("Produkt_id") %></td>

<td align=center width=20% ><%= objRS("Produkt") %></td>

<%

intCurrent = intCurrent + 1

objRS.MoveNext

Wend

objRS.Close()

objConn.Close()

Set objRS = Nothing

Set objCmd = Nothing

Set objConn = Nothing

%>

</table>

was kommt den bei dir ?

hallo,

die erste Spalte ist Produkt_id und die zweite ist Produkt. Das Ergebnis, das ich bekomme ist immer dergleiche egal ob ich der eine oder der andere "radio" Button auswähle, aber das Ergebnis ist eine Tabelle, die nicht einmal sortiert ist.

Ich kann zwar vb net, aber wenn mich net alles täuscht wird die SQL-Query in etwa so


SELECT * FROM LU_Produkt ORDER BY 1

aussehen versuch mal

<input type="radio" name="RadioKnopf" value="produkt" checked>

<input type="radio" name="RadioKnopf" value="produkt_id">

btw würd ich nie select * hernehmen :)

das habe ich auch versucht, die values durch die entsprechenden Namen der Spalten zu erstezen, aber es funktioniert immer noch nicht mit der richtigen Anzeige, vielleicht sollte ich das mit den radios vergessen und anders versuchen...

also mit den values in den Radios kommst du auf jeden fall einmal auf ein SQL-Statement wie zb


SELECT * FROM lu_produkt ORDER BY produkt

versuch mal dieses Statement auszuführen und schau ob sich was verändert

SELECT * FROM lu_produkt ORDER BY produkt DESC

ansonsten fällt mir auf die schnelle nichts ein, was es hier haben könnte....

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.