Page 1 of 1

access database in Kbasic

PostPosted: Tue 28. Apr 2015, 14:20
by Okto
Hi, I am migrating from VB6 to Kbasic, usually I'm using the access database .mdb with the VB6, kindly advise how to write the following lines in Kbasic way :
' The define / declaration of database and it's tables

Dim wrkjet As Workspace
Dim dbkenari As Database
Dim rsbirds As Recordset

Set wrkjet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbkenari = wrkjet.OpenDatabase("kenari.mdb")
Set rsbirds = dbkenari.OpenRecordset("birds")

and how to put the database value into variable :
for example : (Mbirdname as string)
Mbirdname = rsbirds!name

Thank you,
Okto

Re: access database in Kbasic

PostPosted: Thu 30. Apr 2015, 00:11
by Henning
Hi Okto,

You can handle an acces DB using SQL. You said KBasic, but this example is for the newer Q7Basic (Basic4QT).
Hope it will give you some hints.

DatabaseExample.zip
(3.84 KiB) Downloaded 732 times


/Henning