Article ID: 164586
Article Last Modified on 8/25/1999
return ResultFromScode( DB_E_ERRORSOCCURRED );ADO returns an error if the underline providers return E_FAIL when setting the OLE DB properties. The sample text driver needs to return DB_E_ERRORSOCCURRED instead of E_FAIL if there are any unsupported properties encountered.
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{0000022C-0000-0010-8000-
00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000231-0000-0010-8000-
00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000280-0000-0010-8000-
00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000281-0000-0010-8000-
00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000293-0000-0010-8000-
00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"
After you finish the two steps listed above, you can use the following
Visual Basic code to use the sample text provider to retrieve data
from a text file in ADO:
Private Sub myTest()
Dim con As New ADODB.Connection
Dim rs As ADODB.Recordset
' data source specifies path that contains customer.csv
con.Open "provider=sampprov;data
source=c:\\sdks\\oledbsdk\\samples\\sampclnt\\"
Set rs = con.Execute("customer.csv")
For i = 0 To rs.Fields.Count - 1
Print rs.Fields(i).Name
Next i
While Not rs.EOF
Debug.Print rs(0)
rs.MoveNext
Wend
End Sub
Additional query words: ASP
Keywords: kbhowto kbusage KB164586