🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.vbasic
Article #104652

Re: ODBC i uciążliwe pytania o hasło podczas importu z MSSQL do MSAccessa

#104652
From: Jacek
Date: Wed, 02 Jun 2010 14:49
28 lines
1580 bytes
Utworz tabele o nazwie Tabele, a w niej pole Tabela i tam umiesc nazwy
tabel do polaczenia.


Sub PolaczTabele()

Dim db As Database
Dim tb As TableDef
Dim Serwer As String, Uzytkownik As String, Haslo As String

Uzytkownik = "sa"
Haslo = "haslo"
Baza = "Baza"
Set db = CurrentDb

Dim f As DAO.Recordset
Set f = CurrentDb.OpenRecordset("Tabele")
f.MoveFirst
While Not f.EOF()
    Set tb = db.TableDefs(f.Fields("Tabela"))
    tb.Connect = "ODBC;DRIVER=SQL Server;SERVER=" & Serwer & 		
";UID=Uzytkownik;PWD=" & Haslo & ";DATABASE=" & Baza
    tb.RefreshLink
    f.MoveNext
Wend

f.Close
End Sub
Technical Details
Message-ID: <gpanszbfoepv$.1250pz78s0cfz$.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <8a6cb857-8385-4330-879e-b33b05a3e8bb@o12g2000vba.googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: Jacek <ala@ola.pl>
Newsgroups: pl.comp.lang.vbasic
Subject: Re: ODBC i uciążliwe pytania o
 hasło podczas importu z MSSQL do MSAccessa
Date: Wed, 2 Jun 2010 16:49:40 +0200
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 28
Message-ID: <gpanszbfoepv$.1250pz78s0cfz$.dlg@40tude.net>
References: <8a6cb857-8385-4330-879e-b33b05a3e8bb@o12g2000vba.googlegroups.com>
NNTP-Posting-Host: 213-238-125-41.adsl.inetia.pl
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1275490188 7969 213.238.125.41 (2 Jun 2010 14:49:48 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Wed, 2 Jun 2010 14:49:48 +0000 (UTC)
X-User: sha-lom
X-Antivirus: avast! (VPS 100602-0, 2010-06-02), Outbound message
X-Antivirus-Status: Clean
User-Agent: 40tude_Dialog/2.0.15.1pl
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit