473,659 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Seek problem

I'm trying to build a Indonesian-english dictionary/translator
aplication.

I have an unbound form (Form1) with two text field (text1) & (text2)
and two command button (command1) and (command2).

My aim is to type sentences in Indonesian in text1 and translate into
english into text2 trough steps as follows:
1. split the sentences in text1 and store it into tabel T_TEMP (i've
succeded with this )
2. Compare the words in T_TEMP with the table T_MyDict
3. show the result in text2

This is the code i've done so far :

command1 is link to this code:
Private Sub Command1_Click( )
Dim MyRST As DAO.Recordset
Set MyDB = CurrentDb
Set MyRST = MyDB.OpenRecord set("T_TEMP", dbOpenDynaset)
Dim i As Integer
'delete temp data
DoCmd.SetWarnin gs False
DoCmd.RunSQL "DELETE * FROM T_TEMP"
DoCmd.SetWarnin gs True
'
Text1 = Text1 & " " 'add a space just in case 'its just one word
Words = Split(Text1, " ")
With MyRST
For Wordnum = 0 To UBound(Words)
.AddNew
!ID = Wordnum
!mytext = Words(Wordnum)
!txt2 = DLast("mytext", "T_TEMP", "mytext is not null") & " "
& !mytext
'use this to handle two words that have one meaning eg. "rumah
tangga" means "households " in bahasa Indonesia
!txt3 = DLast("txt2", "T_TEMP", "txt2 is not null") & " " & !
mytext
'use this to handle THREE words that have one meaning eg. "DEWAN
PERWAKILAN RAKYAT" means "PARLIAMENT " in bahasa Indonesia
.Update
Next Wordnum
End With
End Sub

command2 is link to this code:
Private Sub Command2_Click( )
call translateIt
End sub

Public Function TranslateIt() As String
Dim dbs As Database, rstMydict As Recordset, rstTemp As Recordset
Dim NumRec As Long

Set dbs = CurrentDb ' Return reference to current database.

Set rstTemp = dbs.OpenRecords et("T_Temp")

Set rstMydict = dbs.OpenRecords et("T_Mydict", , dbOpenDynaset)
' Set index for SEEK
'rstTemp.Index = "primarykey "
'rstTemp.Index = "mytext"
rstMydict.MoveF irst

Do Until rstTemp.EOF = True

rstTemp.Seek "=", rstMydict!Field 1 ', rstTemp!Width

If rstTemp.NoMatch Then

Else
rstTemp.Edit
rstTemp!trnsRes ult = rstMydict!ENGLS
rstTemp.Update
End If
rstMydict.MoveN ext
NumRec = NumRec + 1

Loop
rstTemp.Close
rstMydict.Close
Set dbs = Nothing

MsgBox NumRec - 1 & " Records Processed"

End Function
If i click command2
this error apear:
Runtime error 3265
item no found in this collection
T_TEMP:
MyText
trnsResult
T_Mydict:
Field1 (Indonesian words)
ENGLS (English words)
is there any sugestion on how to solve this
TIA,
Billy

Aug 19 '07 #1
0 1392

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2558
by: Shu-Hsien Sheu | last post by:
Hi, Does the seek method would close the file object after using a for loop? My program looks like this: f = open('somefile', 'r') for lines in f: some operations f.seek(0)
3
4599
by: Pernell Williams | last post by:
Hi all: I am new to Python, and this is my first post (and it won't be my last!), so HELLO EVERYONE!! I am attempting to use "xreadlines", an outer loop and an inner loop in conjunction with "file.tell() and file.seek() in order to navigate through a file in order to print specific lines (for example, every 5th line). Allow me to illustrate by example:
1
4209
by: Waitman Gobble | last post by:
Hello, I am new to Python. I am having trouble with zipfile.py. On a Linux machine with python 2.4.2 I have trouble opening a zipfile. Python is complaining about the bit where it does a seek(-22,2). Looks to me like zipfile.py is trying to come back 22 bytes from the end of file. # python
5
5854
by: MLH | last post by:
I have a table I can open as table type recordset or a dynaset. Searching for a particular value in the table's main keyfield, which would be faster and less strain on the application... FindFirst method - or - Seek method?
11
35761
by: Tiger | last post by:
We can use seek() in the FileStream class,as we know. But I found that seek() is not work correctly in StreamReader. Who can tell me how to use seek() correctly in StreamReader? thanks a lot! I use the seek() like this: StreamReader r; ....... r.BaseStream.seek(.....);
3
4970
by: Mark Denardo | last post by:
Does anyone have any good VB.NET example code that shows how to use the NOTIFY option using the mciSendString API and then handle the return value. The only examples I can find show the VB way using <Form>.hWnd My program basically needs to start a media file and then be informed when it has finished. Right now I have to set up a polling thread to check the status of the playing media file, which works, but causes other parts of my...
59
7491
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when the recordset opens a table. When I write Set rst = db.OpenRecordset("MyTable",dbOpenTable, dbReadOnly) I get an error. I believe it's invalid operation or invalid parameter, I'm
4
1527
by: ataanis | last post by:
I just realized the SEEK method has the same problem, from what I understand, it sets the file pointer to the beginning of the file, and can't be changed!!! I need a way to set the streamreader to a certain place in the line, I already know the column number , am I right that seek is not the right thing to use here? I already tried read() and doesn't work either. thanks
3
6626
by: Jonnh | last post by:
help with use the methods recordset and seek in access because en excel with function database, i know but en access i need seek to table or form, thanks
2
3917
by: mhearne808[insert-at-sign-here]gmail[insert-dot-he | last post by:
I'm having a problem with the File object's seek() method. Specifically, I cannot use it to seek to a location in a binary file that is greater than 2^31 (2147483648). This seems unnecessarily limiting, as it is common these days to have files larger than 2 GB. Is there some LargeFile object out there that I can use to read my file, which is approximately 3.3 GB in size? Python version (freshly built from source this morning): Python...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.