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.

SQL Zugriff von VB .NET aus

Empfohlene Antworten

Hallo Zusammen,

ich probiere schon seit Tagen über SQL auf meine Datenbank zu zugreifen. Habe von VB.NET aus unter Extras-Verbindung zu Datenbank (Typ model) eine Verbindung hergestellt.

Nach ein paar Mal ausprobieren habe ich diese Importsanweisungen eingefügt:

Imports System.Data.SqlClient

Imports System.Data.SqlDbType

Imports System.Data.SqlTypes

Imports System.Data.SqlClient.SqlCommand

Der Microsoftcode dazu wird nicht akzeptiert. Ich würde gerne einen Insert Into Befehl ausführen. Syntax davon ist mir bekannt, aber das in .NET funzt nicht so ganz.

Hilfe:(

SF

Also wenn ich das richtig verstehe, willst du mit VB eine Verbindung zu einer Datenbank herstellen, z.B. MS SQL Server.

Dieser VB Code ermöglicht das:

Option Explicit

Private cnnOrders As New ADODB.Connection

Private rstOrders As New ADODB.Recordset

Private strConnect As String

Private strSQL As String

Private Sub Form_Load()

strConnect = "provider=MSDASQL;driver={SQL Server};server=SERVER01;" & _

"pwd=;database=Versand"

With cnnOrders

.Mode = adModeReadWrite

.CursorLocation = adUseClient

.Open strConnect

End With

strSQL = "SELECT DISTINCT * FROM KUNDE ORDER BY KUNDEN_NR"

Set rstOrders = cnnOrders.Execute(strSQL)

Do Until rstOrders.EOF

cboKundenNr.AddItem rstOrders.Fields(0).Value

rstOrders.MoveNext

Loop

cboKundenNr.ListIndex = 0

rstOrders.Close

End Sub

Ich hoffe das Hilft dir, wenn du was anderes meinst dann schreibe.

In VB.Net wird sie aber das recordset - objekt nicht finden! ;)

Die Datenbankkommunikation erfolgt hier über Objekte wie DataAdapter (zwingend) und DataTable, DataSet, welche die gemäß den Queries zurückgegebenen DataRows enthalten.

Überblick gibts hier:

http://www.microsoft.com/germany/ms/msdnbiblio/show_all.asp?siteid=600123

sowie hier als Powerpointpräsi und/oder Worddokument:

http://www.microsoft.com/germany/ms/msdnbiblio/themen/dotnetrk/ado_net.htm

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.