/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
changing data in a database
Fra : fish


Dato : 16-12-01 17:58

Hey,

With a program that i'm making, it must be posible to put al the variables
of a thing in a database of the computer. I have made this variables with a
new datatype like this:

Type motortype
naam As String
typeingang As String
ingangsnummer As Integer
typeuitgangaan As String
typeuitganguit As String
uitgangaannummer As Integer
uitganguitnummer As Integer
positieleft As Double
positietop As Double
aan As Boolean
bookmark As String
End Type
Global motor(0 To 96) As motortype

After this, a made a new record in my database on this methode for motor(1)
and index=1:

datamotor.Recordset.AddNew
datamotor.Recordset.Fields("motor") = index 'Here is the index of the
variable that i put in the record
datamotor.Recordset.Fields("naam") = Text1
datamotor.Recordset.Fields("typeingang") = "IO"
datamotor.Recordset.Fields("typeuitgangaan") = "IO"
datamotor.Recordset.Fields("typeuitganguit") = "IO"
datamotor.Recordset.Fields("ingangsnummer") = Text2
datamotor.Recordset.Fields("uitgangaannummer") = Text3
datamotor.Recordset.Fields("uitganguitnummer") = Text4
datamotor.Recordset.Fields("positieleft") = motor(index).positieleft
datamotor.Recordset.Fields("positietop") = motor(index).positietop
datamotor.Recordset.Update

When you click on a object with the same index, he has to changes the
positions. In the book pressbook is written that i have to do it as is
written here:

criteria = "motor = " & index
datamotor.Recordset.FindFirst criteria
datamotor.Recordset.Edit
datamotor.Recordset.Fields("positieleft") = motor(index).positieleft
datamotor.Recordset.Fields("positietop") = motor(index).positietop
datamotor.Recordset.Update

But the computer don't understand the second line. What do i wrong??

Thanks for your help,

Jody



 
 
Jan Olsen (18-12-2001)
Kommentar
Fra : Jan Olsen


Dato : 18-12-01 14:21

If You by problems in the second line refer to the line

' datamotor.Recordset.FindFirst criteria'

then the problem could be that You work with a table object, and table
objects doesn't support the .FindFirst method. (Only queries support this),
so you have to look at SEEK method instead.

Jan Olsen
IMC

"fish" <fis007@hotmail.com> skrev i en meddelelse
news:wo4T7.4861$Up1.924@afrodite.telenet-ops.be...
> Hey,
>
> With a program that i'm making, it must be posible to put al the variables
> of a thing in a database of the computer. I have made this variables with
a
> new datatype like this:
>
> Type motortype
> naam As String
> typeingang As String
> ingangsnummer As Integer
> typeuitgangaan As String
> typeuitganguit As String
> uitgangaannummer As Integer
> uitganguitnummer As Integer
> positieleft As Double
> positietop As Double
> aan As Boolean
> bookmark As String
> End Type
> Global motor(0 To 96) As motortype
>
> After this, a made a new record in my database on this methode for
motor(1)
> and index=1:
>
> datamotor.Recordset.AddNew
> datamotor.Recordset.Fields("motor") = index 'Here is the index of the
> variable that i put in the record
> datamotor.Recordset.Fields("naam") = Text1
> datamotor.Recordset.Fields("typeingang") = "IO"
> datamotor.Recordset.Fields("typeuitgangaan") = "IO"
> datamotor.Recordset.Fields("typeuitganguit") = "IO"
> datamotor.Recordset.Fields("ingangsnummer") = Text2
> datamotor.Recordset.Fields("uitgangaannummer") = Text3
> datamotor.Recordset.Fields("uitganguitnummer") = Text4
> datamotor.Recordset.Fields("positieleft") = motor(index).positieleft
> datamotor.Recordset.Fields("positietop") = motor(index).positietop
> datamotor.Recordset.Update
>
> When you click on a object with the same index, he has to changes the
> positions. In the book pressbook is written that i have to do it as is
> written here:
>
> criteria = "motor = " & index
> datamotor.Recordset.FindFirst criteria
> datamotor.Recordset.Edit
> datamotor.Recordset.Fields("positieleft") = motor(index).positieleft
> datamotor.Recordset.Fields("positietop") = motor(index).positietop
> datamotor.Recordset.Update
>
> But the computer don't understand the second line. What do i wrong??
>
> Thanks for your help,
>
> Jody
>
>





Søg
Reklame
Statistik
Spørgsmål : 177552
Tips : 31968
Nyheder : 719565
Indlæg : 6408847
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste