Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jean
Starting Member
6 Posts |
Posted - 2003-04-24 : 15:11:42
|
Hi, the code below works fine with (Access 97)MDB but not in ADP Project (Microsoft Access 2002),I did include the DAO library but still it doesnt work. Any solutions to this problem?.The following example shows how to change the AppIcon and AppTitle properties. If the properties haven't already been set or created, you must create them and append them to the Database object by using the CreateProperty method.Sub cmdAddProp_Click() Dim intX As Integer intX = AddAppProperty("AppTitle", dbText, "My Custom Application") intX = AddAppProperty("AppIcon", dbText, "C:\Windows\Cars.bmp") RefreshTitleBarEnd SubFunction AddAppProperty(strName As String, varType As Variant, varValue As Variant) As Integer Dim dbs As DAO.Database, prp As DAO.Property Const conPropNotFoundError = 3270 Set dbs = CurrentDb On Error GoTo AddProp_Err dbs.Properties(strName) = varValue 'error partAddAppProperty = TrueAddProp_Bye: Exit FunctionAddProp_Err: If Err = conPropNotFoundError Then Set prp = dbs.CreateProperty(strName, varType, varValue) dbs.Properties.Append prp Resume Else AddAppProperty = False Resume AddProp_Bye End If |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-04-24 : 16:32:32
|
ADP's have nothing to do with DAO ...What is the error you get? where does it occur? Doesdim db as dao.databaseset db = currentdbmsgbox db.nameeven work for ADP's ????(don't have 2000 running right now at work ... still stuck with 97 !!!!!)- Jeff |
 |
|
jean
Starting Member
6 Posts |
Posted - 2003-04-24 : 17:08:13
|
im am getting this error message "Object variable or With block variable not set"on this part of the codedbs.Properties(strName) = varValue |
 |
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2003-04-29 : 22:20:36
|
Set a breakpoint at Set dbs = CurrentDb place a watch on each object and see it they are being created and initialized properly. |
 |
|
|
|
|
|
|