Click to See Complete Forum and Search --> : Adodc
Drew
April 12th, 2001, 05:46 PM
I am still trying to connect my Adodc1 control to the database file that is in the same folder as my executable file. I want to be able to burn the program onto a disk and make it work.
I have this code and it does not work.
Dim dbName As String
dbName = App.Path & "\NameandPassords.mdb"
adoNamesAndPasswordsDatabase.ConnectionString = App.Path & "\NameandPassords.mdb"
Robert Moy
April 12th, 2001, 06:50 PM
Hello Drew:
If I understand you correct you want to type in your own password and Userid. For to use ADODC to get to an Oracle table. I used this code to do it at my home PC. You use Access Password for the Oracle Password and get rid of Userid
Private Sub Command2_Click()
Adodc1.RecordSource = "Select " & Text3.Text & _
" from " & Text4.Text & _
" WHERE " & Text5.Text & "=" & Text6.Text
Adodc1.Refresh
End Sub
Private Sub Command3_Click()
Adodc1.ConnectionString = "Provider=MSDAORA. 1;Password=" & Text2.Text & ";User ID=" & Text1.Text & ";Persist Security Info=True"
Adodc1.CommandType = adCmdUnknown
End Sub
I hope this will help you. If you need more help please send back a reply.
Drew
April 12th, 2001, 08:06 PM
My problem is that I need to burn my program onto a CD when I hand it in to my teacher. The program has more than one database. All of the files,forms and databases for the program are in one folder. The path to the database on my computer will not be the same path to the database as the teachers computer. I was trying to do a App.path code in my main form so the Adodc1 control would go directly to where my database is located which is in the same folder that the executable is located. It did not work the way I have coded it. I still can't figure it out.
Cimperiali
April 13th, 2001, 02:23 AM
You can use app.path, but you must call your executable directly from the folder. Ie: make your setup, then search for your exe, then make a shortcut to it where it effectively is, then cut and paste the sortcut on your desktop. Then you can run it from shortcut on desktop and App.path should return the path to your executable (check the shortcut properties right clicking on it and look for "target..." and "start in...").
Hope it helpded
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
greg56
April 25th, 2001, 09:45 AM
It may be too late now, but by any chance are you storing your executable and MDB in the root directory? If the executable is running from root (c:\) then app.path will return "c:\" thus a line such as app.path & "\mydb.MDB" will return "c:\\mydb.mdb" which is not valid. You can test the app.path and then set the path to the MDB as follows
If Right(App.Path,1) = "\" Then
dbname = app.apth & "NameandPassords.mdb"
Else
dbname = App.path & "\Nameandpasswords.mdb"
End If
Then for the adoNames connections tring you can just use adoNamesAndPasswordsDatabase.ConnectionString = App.path & dbname
Although I must say that I am not sure your connection string is right. I don't have too much experience with ADODC controls, but your connection string looks wrong. Usually there are Provider= and Source = in the string.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.