Below is the connection string that i have written in SETTINGS.INI file.
[Connection_String]
Provider = sqloledb
Data_Source= GF\SQLEXPRESS
Initial_Catalog= C1
Integrated_Security= SSPI
User_ID =
Password =
Here is what i have done so far,
Dim MyConnect As New ADODB.Connection
Dim MyRecSet As New ADODB.Recordset
Dim strSQL As String
Dim COMMFilePath As String
COMMFilePath = GetINISetting("COMM", "FilePath", App.Path & "\")
MyConnect.Open _
"Provider = sqloledb;" & _
"Data Source = Trim(GetINISetting("Connection_String", "Data_Source", App.Path & "\SETTINGS.INI"));" & _
"Initial Catalog = Trim(GetINISetting("Connection_String", "Initial_Catalog", App.Path & "\SETTINGS.INI"));" & _
"Integrated Security = Trim(GetINISetting("Connection_String", "Integrated_Security", App.Path & "\SETTINGS.INI"));" & _
"User ID = Trim(GetINISetting("Connection_String", "User_ID", App.Path & "\SETTINGS.INI"));" & _
"Password = Trim(GetINISetting("Connection_String", "Password", App.Path & "\SETTINGS.INI"));"
'My other code below....
I have tried using a textbox to display the string from the INI file and it works using the Trim function.
So,the only thing i could figure is there is syntax error in my vb6 code and i have searched high and low for it but still couldn't find it.
Anyone that can guide or help me on this? Any help would be much appreciated.Thanks

New Topic/Question
Reply




MultiQuote



|