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.

Daten aus einer Datenbank in eine Listbox schreiben

Empfohlene Antworten

MORGEN!!!

Ich arbeite mit dem vc studio und hänge etzt irgendwie in den seilen.

Hier erstmal der Quellcode:

void C1stView::OnInitialUpdate()

{

CFormView::OnInitialUpdate();

m_pConnect = ((CMainFrame*) GetParentFrame())->m_pConnect;

table = new COdbcTable ("BRZLEXIKON") ;

int rc = table->Open(MODE_READ,m_pConnect);

if( rc != BRZSQL_NO_ERROR )

{

MessageBox("FEHLER!!!");

return;

}

rc = table->StmtRead("SELECT (ID)from BRZLEXIKON ");

if( rc == BRZSQL_NO_ERROR ) //Satz ist vorhanden

{

CString strBezeichnung =(char*)table->Col("ID");

m_indexeintrag.SetWindowText("strBezeichnung");

}

HICON hIcon=AfxGetApp() ->LoadIcon(IDI_ICON1);

m_hinzu.SetIcon(hIcon);

UpdateData(TRUE);

Alles funktioniert

nur irgendwie krieg ich nix in die listbox rein.

MFG

cleo

[Weibchen der CAMPER-CREW 2002]

Original geschrieben von Cleo

MORGEN!!!

m_indexeintrag.SetWindowText("strBezeichnung");

}

1. Lass die Hochkommata erstmal weg in SetWindowText.

2. Überprüf mal, ob du überhaupt einen Datensatz zurückbekommst.

3. Was ist m_indexeintrag für eine Variable ??

m_indexeintrag is die member von der listbox bzw listenelement

und ja ich bekomme einen datensatz zurück und des mit dem hochkomma weglassen funktioniert auch nicht.

Hab grad n testprojekt erstellt aber auch da gehts nix rein selbst wenn ich ihm die werte direkt reinschreibe

MFG

cleo

[Weibchen der CAMPER-CREW 2002]

Also wenn deine Member wirklich von CListBox stammt, dann versuchs mal mit AddString() .

jep funktioniert!

DANKE!

MFG

cleo

[weibchen der CAMPER-Crew 2002]

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.