I am a brand new user to RFT. I just walked through the example of how to connect to an access DB in the book "Software Test Engineering with IBM Rational Functional Tester". I am getting an error when I try to run the script stating the following;
1 - Namespace or type specified in the Imports 'System.Data.OleDb' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
2 - Type 'OleDbConnection' is not defined.
I assume this is regarding my imports statement at the top of the script (Imports System.Data.OleDb). When I don't use this import and give the full name of the connection (System.Data.OleDb.OleDbConnection) I still get an error. My code is below and it is straight out of the book. Any and all help is greatly appreciated. Thanks so much. Talk to you soon.
Public Function TestMain(ByVal args() As Object) As Object
' Connection String to MS Access DB
Dim connectStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Users\DMalerman\keyword.accdb;" & _
"Persist Security Info=True"
' Create connection to the db
Using connection As New System.Data.OleDb.OleDbConnection(connectStr)
' Create the SQL Query
Dim readQuery As String = "Select KeywordDriver.ScriptName from KeywordDriver " & _
"where KeywordDriver.Keyword = test"
Dim queryCommand As New OleDbCommand(readQuery, connection)
'Open the Connection
' Query the Database
Dim dbReader As OleDbDataReader = queryCommand.ExecuteReader()
' Loop until there is nothing left to read
Dim sKeyword As String = ""
sKeyword = dbReader.GetString(0)
' Close the Reader
This topic has been locked.
1 reply Latest Post - 2012-11-21T15:40:22Z by SystemAdmin
Pinned topic RFT Using VB.Net To Connect To MS Access DB
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-11-21T15:40:22Z at 2012-11-21T15:40:22Z by SystemAdmin
SystemAdmin 110000D4XK16727 Posts