/
Forside
/
Teknologi
/
Udvikling
/
VB/Basic
/
Nyhedsindlæg
Login
Brugernavn
*
Kodeord
*
Husk mig
Brugerservice
Kom godt i gang
Bliv medlem
Seneste indlæg
Stil et spørgsmål
Skriv et tip
Pointsystemet
Kontakt Kandu.dk
Emnevisning
Kategorier
Alfabetisk
Karriere
Interesser
Teknologi
Reklame
Top 10 brugere
VB/Basic
#
Navn
Point
1
berpox
2425
2
pete
1435
3
CADmageren
1251
4
gibson
1230
5
Phylock
887
6
AntonV
790
7
strarup
750
8
Benjamin...
700
9
tom.kise
610
10
EXTERMINA..
600
change db-connection
Fra :
Susan
Dato :
18-10-06 08:08
Hello,
I have a Form with a ADOC-coonection. Using the properties I point to a
database and a table and I define a connectionstring.
Iwant to usr a commandbutton to change these properties. Is this possible?
Private Sub Command1_Click()
'change adodc1.database
'change adodc1.table
End Sub
Thanks,
Susan
leerstring (
18-10-2006
)
Kommentar
Fra :
leerstring
Dato :
18-10-06 12:18
I dont't use the adodc-control for getting datas from a db, perhaps use
a connection-object and a recordset-object! I think you have more
control with this.
But anyway, adodc works with a cn-string and an sql-query
(select-statement).
Changeing these two properties should be enough...
Like:
dim cnstring1 As String = " "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\mydb.mdb;User Id=admin;Password=;"" 'with this its
initialised
dim cnstring2 As String = " "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\myotherdb.mdb;User Id=admin;Password=;"" 'a runtime to this
changeable
Private Sub Command1_Click()
adodc1.connectionstring = cnstring2
adodc1.table = "newtable" 'I don't know exactly, could also be an
sql-query?!?
End Sub
Hope I can help
Nullstring
Søg
Alle emner
Teknologi
Udvikling
VB/Basic
Indstillinger
Spørgsmål
Tips
Usenet
Reklame
Statistik
Spørgsmål :
177821
Tips :
31980
Nyheder :
719565
Indlæg :
6410979
Brugere :
218912
Månedens bedste
Årets bedste
Sidste års bedste
Copyright © 2000-2026 kandu.dk. Alle rettigheder forbeholdes.