/
Forside
/
Teknologi
/
Udvikling
/
VB/Basic
/
Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn
*
Kodeord
*
Husk mig
Brugerservice
Kom godt i gang
Bliv medlem
Seneste indlæg
Find en bruger
Stil et spørgsmål
Skriv et tip
Fortæl en ven
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
gandalf
836
7
AntonV
790
8
strarup
750
9
Benjamin...
700
10
tom.kise
610
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 :
177558
Tips :
31968
Nyheder :
719565
Indlæg :
6408914
Brugere :
218888
Månedens bedste
Årets bedste
Sidste års bedste
Copyright © 2000-2024 kandu.dk. Alle rettigheder forbeholdes.