hi
i want to change connection(database) and command1's RecordSource (Tables) of DataGrid??
Printable View
hi
i want to change connection(database) and command1's RecordSource (Tables) of DataGrid??
I'm not really sure what you are trying to do here. Can you elaborate maybe step by step what is happening and what you need to happen
Private Sub Command4_Click()
Dim dbn As String
dbn = "C:\windows\desktop\sarfraz\p\data\"
DataEnvironment1.Connection1.ConnectionString = dbn & Form8.List1.ListIndex & ".mdb"
message 3705 object is open (etc...)
You can't rename a file (any file) while that file is open.
So, to do what you want, your program must first, close the database and remove all connections to it. Then, you can do a rename and reset the recordsource.
basically this is what hack was trying to say.
VB Code:
dataenvironment1.connection1.close dataenvireonment1.connection1.connectionstring=newdb