Question about Computers & Internet

1 Answer

About EOF and BOF

Heya, sorry for my bad english language... *_*

i wanna ask about it,

i have the code like this :

-----------------------------------
Private Sub btnCommand_Click(Index As Integer)
Select Case Index

Case 0
If frmPetugasView.Tag = "New" Then

frmPetugasView.Adodc1.Recordset.AddNew

frmPetugasView.Adodc1.Recordset!PetugasID = txtInput(0).Text
frmPetugasView.Adodc1.Recordset!NamaPetugas = txtInput(1).Text
frmPetugasView.Adodc1.Recordset!Keterangan = txtInput(2).Text
frmPetugasView.Adodc1.Recordset.Update

ElseIf frmPetugasView.Tag = "Edit" Then

frmPetugasView.Adodc1.Recordset!PetugasID = txtInput(0).Text
frmPetugasView.Adodc1.Recordset!NamaPetugas = txtInput(1).Text
frmPetugasView.Adodc1.Recordset!Keterangan = txtInput(2).Text
frmPetugasView.Adodc1.Recordset.Update

End If

Case 1

Unload Me
End Select

End Sub
-------------------------------

when i gonna input new data, it show entered data at frmPetugasView

but, when i put same number at primary key then the vb6 show this error code (run time error 80004005)


my teacher show me about using 'if' command for using EOF and BOF for denying same data at primary key, but i lost contact with her for a month.

can someone help me??~

i hope the code is :

option 1 =
when same data entered, input aborted and show dialog with information about aborted process

option 2 =
generate +1 number at last of ID at primary key (i'm using number for primary key)


but i need option 1 better than 2 (i just need that both for my studying... but i need the first one for my project)

Posted by on

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Corporal:

    An expert that hasĀ over 10 points.

    Mayor:

    An expert whose answer gotĀ voted for 2 times.

    Problem Solver:

    An expert who has answered 5 questions.

  • Contributor
  • 10 Answers

Hello Gugukandmiaw
You do not have to use the elseif statement. Maybe this will work.
Greetings Fred Roubos.


With frmPetugasView.Adodc1.Recordset
If frmPetugasView.Tag = "New" Then
.AddNew
!PetugasID = txtInput(0).Text
!NamaPetugas = txtInput(1).Text
!Keterangan = txtInput(2).Text
.Update
End if

If frmPetugasView.Tag = "Edit" Then
!PetugasID = txtInput(0).Text
!NamaPetugas = txtInput(1).Text
!Keterangan = txtInput(2).Text
.Update
End If
End With

Posted on Dec 24, 2008

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

I wanna change the language of my Sony Bravia KDL40V2500 from japanese to english and i can't do it. How can i?


Most language options on electronics are found under "Settings"
Switch on
Menu
Settings
Preference
Language

Sep 22, 2015 | Sony BRAVIA KDL-40V2500 40 in. LCD HDTV

1 Answer

Either BOF or EOF is True


The BOF property returns True (-1) if the current record position is before the first record in the Recordset, otherwise it returns False (0).
The EOF property returns True (-1) if the current record position is after the last record in the Recordset, otherwise it returns False (0).

Jan 11, 2014 | Computers & Internet

1 Answer

Language arabic


What is the actual problem, you didn't tell that.
Is phone language is arabic or you wanna change the language.
Actually set has English, Spanish and French.
if you wanna change to arabic than download the jar file and install it

Dec 23, 2010 | LG Vu CU920 Cellular Phone

1 Answer

My laptop is installed with OS in German which I cant understand. I want to change it to English. what steps should I follow? Thanks in advance


Heya

First of all
Click on start
Go to control panel
Then click on Regional and language setting
Click on regional options
Select english from the drop down menu
Then click on advanced and select english again from the drop down menu
Click on apply and then OK
Hope this fixes your problem

If this doesn't fixes your problem than the base version of windows is german,So in order to change that unfortunately you would have to reinstall windows again with a fresh english version copy

Thanks & Regards

LOnG lIve thE gEeKS!!!!!

Dec 11, 2010 | ASUS Eee 4G Notebook

1 Answer

When printing a label on brother QL-1050 printer comes up with error "Either BOF or EOF is true or the current record has been deleted Requested operation requires a current record" I have removed...


I solved this problem by pressing "Control N" to bring up a new label. Works fine that way.
This is the answer Brother gave when I called them:

Description of Problem 100000003722
When I click print I receive the error message: Either BOF or EOF is true, or the current record has been deleted.
Description of Solution 200000004488
This error message occurs when you print a label that has no record in the database table.
To avoid this error message, click on Database menu, select Create New Record.

Oct 09, 2010 | Brother QL-1050 Label Printer

2 Answers

I wanna change the japanese version to english


access your bios set up and change the language. If you don't know how to access your bios, look the screen when the system is booting up or use the manual. I hope they allow other languages in the bios. Just change the language cuz if u try experiments u will have bad surprises....this place is where it's configure how everything work on your computer!!!!

Sep 18, 2009 | Fujitsu Computers & Internet

1 Answer

Book mark property of recordset (ado)


The bookmark property of a recordset lets you store and retrieve the location of a record in a variable so that you can move directly to it in your recordset without having to use a query to extract that record. Like you can just move forward a record and back a record, or move to the first or last records without a quesry statement, you can move to the bookmarked record directly in code.

Here's a good VB example that compares the bookmakr property to the movefirst and movelast properties. This should answer your question, and please rate my answer.

'BeginBOFVB 'To integrate this code 'replace the data source and initial catalog values 'in the connection string Public Sub Main() On Error GoTo ErrorHandler 'recordset and connection variables Dim Cnxn As ADODB.Connection Dim rstPublishers As ADODB.Recordset Dim strCnxn As String Dim strSQLPubs As String 'record variables Dim strMessage As String Dim intCommand As Integer Dim varBookmark As Variant ' open connection Set Cnxn = New ADODB.Connection strCnxn = "Provider='sqloledb';Data Source='MySqlServer';" & _ "Initial Catalog='Pubs';Integrated Security='SSPI';" Cnxn.Open strCnxn ' Open recordset and use client cursor ' to enable AbsolutePosition property Set rstPublishers = New ADODB.Recordset strSQLPubs = "SELECT pub_id, pub_name FROM publishers ORDER BY pub_name" rstPublishers.Open strSQLPubs, strCnxn, adUseClient, adOpenStatic, adCmdText rstPublishers.MoveFirst Do Until rstPublishers.EOF ' Display information about current record ' and get user input strMessage = "Publisher: " & rstPublishers!pub_name & _ vbCr & "(record " & rstPublishers.AbsolutePosition & _ " of " & rstPublishers.RecordCount & ")" & vbCr & vbCr & _ "Enter command:" & vbCr & _ "[1 - next / 2 - previous /" & vbCr & _ "3 - set bookmark / 4 - go to bookmark]" intCommand = Val(InputBox(strMessage)) ' Check user input Select Case intCommand Case 1 ' Move forward trapping for EOF rstPublishers.MoveNext If rstPublishers.EOF Then MsgBox "Moving past the last record." & _ vbCr & "Try again." rstPublishers.MoveLast End If Case 2 ' Move backward trapping for BOF rstPublishers.MovePrevious If rstPublishers.BOF Then MsgBox "Moving past the first record." & _ vbCr & "Try again." rstPublishers.MoveFirst End If Case 3 ' Store the bookmark of the current record varBookmark = rstPublishers.Bookmark Case 4 ' Go to the record indicated by the stored bookmark If IsEmpty(varBookmark) Then MsgBox "No Bookmark set!" Else rstPublishers.Bookmark = varBookmark End If Case Else Exit Do End Select Loop ' clean up rstPublishers.Close Cnxn.Close Set rstPublishers = Nothing Set Cnxn = Nothing Exit Sub ErrorHandler: ' clean up If Not rstPublishers Is Nothing Then If rstPublishers.State = adStateOpen Then rstPublishers.Close End If Set rstPublishers = Nothing If Not Cnxn Is Nothing Then If Cnxn.State = adStateOpen Then Cnxn.Close End If Set Cnxn = Nothing If Err <> 0 Then MsgBox Err.Source & "-->" & Err.Description, , "Error" End If End Sub 'EndBOFVB

Jan 07, 2009 | Microsoft Visual Basic 6.0 for PC

1 Answer

Vb 6.0 ado connection without ado control moving next record


I see 2 problems with your code.

1) Each time you call cmdnext_Click, you're reopening the database. Each time you do that, you start at the beginning of the file. You need to have the database opened once, somewhere else in your program. Be sure that the record set is visible from this sub.

2) In order to use the "Next" function, you need a loop like this

'test for no records
IF REC.BOF and REC.EOF then
msgbox "No Records Found"
exit sub
end if

IF NOT REC.EOF then
REC.MoveNext
(display your fields)
END IF


Again, this will only work if your database is opened outside of the cmdNext_Click routine.

Jul 08, 2008 | Microsoft Computers & Internet

1 Answer

Language settings


Sorry but I have bad news for you. If you buy one product like PDA or Notebook you buy automatically OS with license. As far as i know Microsoft do not sell Pocket PC as retail product. I can not understund why Microsoft does not sell the different language as they do for Windows XP. Therefor, a German PDA may not be flashed with another language version. Only what you can do is make some updates in the installed language. If you want to have PDA with English OS you must ask your local dealer whether it is possible to order such one.

Sep 11, 2005 | Toshiba e400 Pocket PC

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

136 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

98921 Answers

David Payne
David Payne

Level 3 Expert

14089 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...