Using an Access database with TX Text Control .NET for Windows Forms
Using TX Text Control ActiveX and Visual Basic 6, you can use an ADO Data Control (ADODC) to select records from a database or create a database connection at run-time. In Visual Basic .NET, you can do exactly the same; however there are a few differences in the implementation.
This newsletter shows you how to work with an Access database using TX Text Control .NET for Windows Forms.
We use the OLE database connection to open an Access database. First of all, we need to create a connection string that contains the path of the database and the database interface that is being used. Using this string, we create a new OLE database connection.
strPath = CurDir(Application.ExecutablePath) & "\rtf_default.mdb"
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath
oleCon = New System.Data.OleDb.OleDbConnection(strCon)
After declaring the connection and setting the Connection string, we can open the database.
oleAdp = New System.Data.OleDb.OleDbDataAdapter("select * from Table1", oleCon)
The SQL statement SELECT fills a DataSet with the rows of Table1. To get the values of a specific field in a row we create a DataRow and fill it with the specific data.
Dim rw As DataRow = dsF.Tables("Table1").Rows(iRw)
One database field in a row can be accessed by specifying the columns name.
Dim btBuffer As String = rw("document")
In our sample, we have a database storing RTF documents. These documents are going to be loaded into a variable and imported into TX Text Control .NET for Windows Forms using the Load method.
To insert a document into the database, we have to save the contents to a variable and insert them into the database using the INSERT SQL statement. In this sample, we step forward and backwards through the database and insert new documents into the database in RTF format.
Dim sqlStr As String = "Insert Into Table1(document) VALUES_
('" & txContent & "')"
In order that this example applications will run, you have to have TX Text Control .NET for Windows Forms (trial or full) and Visual Studio .NET 2003 installed on your PC.
Working with RSS Feeds
In last week's newsletter, we launched a series of RSS feeds that have been designed to keep you up to date with TX Text Control news and happening is the TX Text Control forum.
We have had a good response with several thousand downloads of the XML files. However, after speaking to some customers, we realize that many of you are not familiar with the RSS technology.
What are RSS Reeds?
Think of an RSS Feed as a kind of web page and the RSS Reader as a browser. Once you have subscribed to our RSS feeds, your RSS Reader will download the RSS feeds at a predetermined rate (probably several times a day). Whenever you want to learn what is new at textcontrol.com, you can simply click on one of the TX Text Control feeds in your RSS Reader, scan the headlines and read only what is of interest to you.
How can I use them?
The screenshot below shows FeedReader, a basic RSS Reader, that can be downloaded freely. There are many more RSS Readers that offer considerably more comfort and features. However, as a starting point, we would suggest that you download and install this one.
Why is RSS better than surfing the web or reading e-mail newsletters?
Unlike the web, where you have to go looking for a site, and can never be sure what is updated and when; or e-mail newsletters, which are often incorrectly caught in spam filters, our RSS feeds provide information that is targeted, filtered and gives you the choice of whether to read a new item or skip over it.
Subscribe to the TX Text Control RSS feeds today and never miss any TX Text Control news again. It is completely free and anonymous. Just add the feeds to your RSS Reader!
The Newsletter Team