Hello All,
I am reading ini file to open DB connection.
I am having problem generating cnn string to open DB
here is some of the code, hope to get some help.
Dim dummy As String
Dim odbcName As String * 255
Dim user As String * 255
Dim pwd As String * 255
Dim buffer as string * 1024
Dim FileName As String
FileName = ftpConfig.GetINIFileName
dummy = GetPrivateProfileString("ODBC", "name", "", odbcName, Len(odbcName), FileName)
dummy = GetPrivateProfileString("ODBC", "user", "", user, Len(user), FileName)
dummy = GetPrivateProfileString("ODBC", "pwd", "", pwd, Len(pwd), FileName)
buffer = "DSN=" + odbcName + ";UID=" + user + ";PWD=" + pwd
cnn.open buffer '' Error on this line.
when I did msgbox(buffer) i got DSN=ODBCName which is correct but not the rest of the values
thanks
I am reading ini file to open DB connection.
I am having problem generating cnn string to open DB
here is some of the code, hope to get some help.
Dim dummy As String
Dim odbcName As String * 255
Dim user As String * 255
Dim pwd As String * 255
Dim buffer as string * 1024
Dim FileName As String
FileName = ftpConfig.GetINIFileName
dummy = GetPrivateProfileString("ODBC", "name", "", odbcName, Len(odbcName), FileName)
dummy = GetPrivateProfileString("ODBC", "user", "", user, Len(user), FileName)
dummy = GetPrivateProfileString("ODBC", "pwd", "", pwd, Len(pwd), FileName)
buffer = "DSN=" + odbcName + ";UID=" + user + ";PWD=" + pwd
cnn.open buffer '' Error on this line.
when I did msgbox(buffer) i got DSN=ODBCName which is correct but not the rest of the values
thanks