Page 1 of 1 1
Topic Options
#43517 - 2003-07-29 10:57 AM How to read info from ACCESS
thijs Offline
Fresh Scripter

Registered: 2003-05-09
Posts: 14
Loc: The nederlands
[Moderator (Sealeopard): Moved thread from 'Scripts' to 'Starters' forum due to lack of script in body]

I have an question:

I am making an program for my cd collection i have al ready got 400 so thougt lets put it in an database.

- Writing it into the database is oke an no error's
- But reading the information that is the problem.

When it is finished ill put it on the site.

Thijs

[ 29. July 2003, 14:45: Message edited by: sealeopard ]

Top
#43518 - 2003-07-29 01:50 PM Re: How to read info from ACCESS
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Can you show us your code?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#43519 - 2003-07-29 02:47 PM Re: How to read info from ACCESS
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please read ABC's of KiXtart board etiquette and message to new forum users , especially Section F.

Also, please take a look at the UDF Forum, it contains a collection of database UDFs that might be helpful.
_________________________
There are two types of vessels, submarines and targets.

Top
#43520 - 2003-07-31 10:49 AM Re: How to read info from ACCESS
thijs Offline
Fresh Scripter

Registered: 2003-05-09
Posts: 14
Loc: The nederlands
This is just the pice of the script that will write to the database. But how to read

I hoop you will have they answer.

Thijs
--------------------------------------------
$db = CreateObject("ADODB.Connection")

$db.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ="+ $DBPath + $DBName)

$sSQL = "CREATE TABLE CD (id COUNTER, Naam TEXT(255) PRIMARY KEY, Serial TEXT(255), Beschrijving TEXT(255), Besturingssysteem TEXT(255))"
$rs = $db.Execute($sSQL)
$sSQL = "INSERT INTO CD (Naam, Serial, Beschrijving) VALUES ('"+ $naam +"', '"+ $serial +"', '" + $beschrijving + "')"
$rs = $db.Execute($sSQL)

;If $chkbestuur.Value + $chkbestuur2.Value + $chkbestuur3.Value + $chkbestuur4.Value = 1
;$sSQL = "CREATE TABLE CD (id COUNTER, Besturingssysteem TEXT(255))"
;$rs = $db.Execute($sSQL)

If $chkbestuur.Value = "\1"
$chkbestuur.Value = "Windows XP"
$sSQL = "INSERT INTO CD (Besturingssysteem) VALUES ('"+ $chkbestuur.Value +"')"
$rs = $db.Execute($sSQL)
EndIf

If $chkbestuur2.Value = 1
;$chkbestuur2.Value= "Windows 2000 Profesional"
$sSQL = "INSERT INTO CD (Besturingssysteem) VALUES ('Windows 2000 professional')"
$rs = $db.Execute($sSQL)
EndIf

If $chkbestuur3.Value = 1
$chkbestuur2.Value= "Windows 95/98/ME"
$sSQL = "INSERT INTO CD (Besturingssysteem) VALUES ('"+ $chkbestuur3.Value +"')"
$rs = $db.Execute($sSQL)
EndIf

If $chkbestuur4.Value = 1
$chkbestuur4.Value= "Windows NT 4.0"
$sSQL = "INSERT INTO CD (Besturingssysteem) VALUES ('"+ $chkbestuur4.Value +"')"
$rs = $db.Execute($sSQL)
EndIf

If $chkbestuur5.Value = 1
$chkbestuur5.Value= "Windows 2000 Server"
$sSQL = "INSERT INTO CD (Besturingssysteem) VALUES ('"+ $chkbestuur5.Value +"')"
$rs = $db.Execute($sSQL)
EndIf

;EndIf

; $sSQL = "CREATE TABLE CD (id COUNTER, Besturingssysteem TEXT(255))"
; $rs = $db.Execute($sSQL)
;
; Maken van een tabel
; $sSQL = "CREATE TABLE CD (id COUNTER, Naam TEXT(255) PRIMARY KEY, Serial TEXT(255), Beschrijving TEXT(255))"
; $rs = $db.Execute($sSQL)
;
;Input geven aan de boven gemaakte tabel

;Verwijderen van de Tabel
;$sSQL = "DROP TABLE AllComputers"
;$rs = $db.Execute($sSQL)
$lstnames.AddItem ("$naam " + "$beschrijving " + "$serial")
Sleep 1
$text.Text = ""
$text2.Text = ""
$text3.Text = ""
$chkbestuur.Value = 0
$chkbestuur2.Value = 0
$chkbestuur3.Value = 0
$chkbestuur4.Value = 0
$chkbestuur5.Value = 0
:End
EndFunction

Top
#43521 - 2003-07-31 03:40 PM Re: How to read info from ACCESS
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I still don't understand your problem. You seem to understand the concept of using SQL code, so where's the problem in using a SELECT statement?

Secondly, as I already pointed out, the UDF Fourm contaisn a complete set of UDFs designed to interface with databases, including MS Access. Use them!

Also what is this
code:
:End
EndFunction

doing in your code if you don't even create a function or subroutine? [Confused]
_________________________
There are two types of vessels, submarines and targets.

Top
#43522 - 2003-08-01 09:50 AM Re: How to read info from ACCESS
thijs Offline
Fresh Scripter

Registered: 2003-05-09
Posts: 14
Loc: The nederlands
Sorry i have they selution. I had make an mistake in the select command.
And about the UDF's i didn't thought of it.

Thanks for your help.

Thijs

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 202 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.054 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org