Zugriff mit VBA aus Excel über ODBC auf MSSQL
Ohne das ich Benutzername und Passwort in VBA-Code einzusehen ist
Hallo,
eine Lösung für MySQL hab ich bereits realisiert, aber für MSSQL bin ich verzweifelt auf der Suche.
Ich möchte eine Verbindung zwischen Excel VBA über ODBC auf eine Microsoft SQL Datenbank erstellen, aber ohne das ich den Benutzernamen und das Passwort in den VBA-Code einpflege.
Bsp. für MySQL:
Set Conn = CreateObject("ADODB.Connection")
Conn.Open "Provider=MSDASQL.1;DATA SOURCE=ODBCNAMEN"
Set rec = CreateObject("ADODB.Recordset")
Nun suche ich das selbe Prinzip für MSSQL.
Kann mir einer weiterhelfen.
Danke im voraus.
Euer KgFmB
eine Lösung für MySQL hab ich bereits realisiert, aber für MSSQL bin ich verzweifelt auf der Suche.
Ich möchte eine Verbindung zwischen Excel VBA über ODBC auf eine Microsoft SQL Datenbank erstellen, aber ohne das ich den Benutzernamen und das Passwort in den VBA-Code einpflege.
Bsp. für MySQL:
Set Conn = CreateObject("ADODB.Connection")
Conn.Open "Provider=MSDASQL.1;DATA SOURCE=ODBCNAMEN"
Set rec = CreateObject("ADODB.Recordset")
Nun suche ich das selbe Prinzip für MSSQL.
Kann mir einer weiterhelfen.
Danke im voraus.
Euer KgFmB
Please also mark the comments that contributed to the solution of the article
Content-Key: 103083
Url: https://administrator.de/contentid/103083
Printed on: April 19, 2024 at 12:04 o'clock
1 Comment