quaked2023
Technical User
Hello!: I downloaded a vb project from the internet but i don't understand the code completely... here is the code:
Dim dbname As String
Dim db As Database
' Open the database.
dbname = App.Path
If Right$(dbname, 1) <> "\" Then dbname = dbname & "\"
dbname = dbname & "data.mdb"
Set db = OpenDatabase(dbname)
Now i know what the code does, that is to open a database using the control data the part that i don't understand is the If part... i have no idea what is the if for, what does Right$(dbname,1) means.... i also notice that ther is no END IF but there is no error because of this.
Can you help me? Thanks in advance (sorry for my bad english)
-The Only Privacy Left Is The Inside Of Your Head!- QUAKED2023
Dim dbname As String
Dim db As Database
' Open the database.
dbname = App.Path
If Right$(dbname, 1) <> "\" Then dbname = dbname & "\"
dbname = dbname & "data.mdb"
Set db = OpenDatabase(dbname)
Now i know what the code does, that is to open a database using the control data the part that i don't understand is the If part... i have no idea what is the if for, what does Right$(dbname,1) means.... i also notice that ther is no END IF but there is no error because of this.
Can you help me? Thanks in advance (sorry for my bad english)
-The Only Privacy Left Is The Inside Of Your Head!- QUAKED2023