HI vb Wizards, good day, just wanted to ask if somebody there can help me iwth my problem. Am having difficulty in adding up records in my table, the table is in Microsoft Access format.
It Like this when i run my program, there no conflicts at no error pop up message or anything. but not satisfied with the outcome, here my code: -
Private Sub Command3_Click()
-
Dim rsShowRec As New ADODB.Recordset
-
Dim cnn As New ADODB.Connection
-
-
Set cnn = New ADODB.Connection
-
cnn.ConnectionString = _
-
"Provider=Microsoft.Jet.OLEDB.3.51;" & _
-
"Data Source=" & App.Path & "\dbTimeScheduling2.mdb;"
-
cnn.Open
-
-
-
-
Set rsShowRec = New ADODB.Recordset
-
-
For x = 0 To 15
-
rsShowRec.Source = "Select * from RECORDS Where CODE = 'txtCode(x).Text' "
-
rsShowRec.Open , cnn, adOpenStatic, adLockOptimistic
-
-
If Not rsShowRec.EOF Then
-
Else
-
rsShowRec.AddNew
-
If IsNull(txtCode(x).Text) Then rsShowRec.Fields("CODE") = "" Else rsShowRec.Fields("CODE") = UCase(txtCode(x).Text)
-
-
rsShowRec.Update
-
Set rsShowRec = Nothing
-
End If
-
Next
-
-
MsgBox ("Records are Added")
-
End Sub
-
it doesnt anything at all, it appends a blank entries on my tables, but thats not what i want... i do suspect that theres a problem on my sql statement, i hope somebody can configure out or tell me whats wrong with my codes.
Really hoping fro your help... i cant understand why it doesnt add up the records in my table from my form (txtCode.txt).. but the it up add up only the rows which are blanks i dont why?.... it seems like it doesnt get value of my textboxes to save in the table..
Thank you very much for any help..
2 1234
HI vb Wizards, good day, just wanted to ask if somebody there can help me iwth my problem. Am having difficulty in adding up records in my table, the table is in Microsoft Access format.
It Like this when i run my program, there no conflicts at no error pop up message or anything. but not satisfied with the outcome, here my code: -
Private Sub Command3_Click()
-
Dim rsShowRec As New ADODB.Recordset
-
Dim cnn As New ADODB.Connection
-
-
Set cnn = New ADODB.Connection
-
cnn.ConnectionString = _
-
"Provider=Microsoft.Jet.OLEDB.3.51;" & _
-
"Data Source=" & App.Path & "\dbTimeScheduling2.mdb;"
-
cnn.Open
-
-
-
-
Set rsShowRec = New ADODB.Recordset
-
-
For x = 0 To 15
-
rsShowRec.Source = "Select * from RECORDS Where CODE = 'txtCode(x).Text' "
-
rsShowRec.Open , cnn, adOpenStatic, adLockOptimistic
-
-
If Not rsShowRec.EOF Then
-
Else
-
rsShowRec.AddNew
-
If IsNull(txtCode(x).Text) Then rsShowRec.Fields("CODE") = "" Else rsShowRec.Fields("CODE") = UCase(txtCode(x).Text)
-
-
rsShowRec.Update
-
Set rsShowRec = Nothing
-
End If
-
Next
-
-
MsgBox ("Records are Added")
-
End Sub
-
it doesnt anything at all, it appends a blank entries on my tables, but thats not what i want... i do suspect that theres a problem on my sql statement, i hope somebody can configure out or tell me whats wrong with my codes.
Really hoping fro your help... i cant understand why it doesnt add up the records in my table from my form (txtCode.txt).. but the it up add up only the rows which are blanks i dont why?.... it seems like it doesnt get value of my textboxes to save in the table..
Thank you very much for any help..
Check your SQL statement.
-----
rsShowRec.Sourc e = "Select * from RECORDS Where CODE = '" & txtCode(x).Text & "' "
thank you very very very much, it works, i have a little sharing to i used jet 4.0 instead of jet 3.51, it works very well on it.. again thank you.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jamie Fryatt |
last post by:
Hi everyone, here's what id like to do.
I have a table with 2 fields, name and value
I need to be able to add multiple records quickly, for example I need to add
name value
abc 1
abc 2
abc 3
|
by: Manish Sawjiani |
last post by:
Hi Experts,
I am just into dot net and i want simple code for adding records into Access
table (97) using oledb. There are no queries in the databases and there is
only one table:
Friends with the following fields: FriendID (AutoNumber) FirstName, LastName
and DateOfBirth
Please I have tried everything. WOULD BE HIGHLY OBLIGED for HELP
...
|
by: k |
last post by:
Hi all
I split a database in a table-part and a all-the-rest-part and linked
the tables, but my code adding records to a table crashes on
Set rs = db.OpenRecordset("tblDeltakelse", dbOpenTable,
dbAppendOnly)
I think, some places where I do the same thing to another table it just
says "Invalid Operation", I press OK and nothing happens,...
|
by: brijeshmathew |
last post by:
Hi
I use Visual Basic 6, Service Pack 6, Microsoft ActiveX Data Objects
2.8 Library(msado15.dll) and access 2000 database using JET 4 OLE. I
have an application that adds records simultaneously to the same table.
During the simultaneous add and update, a Locked error occurs, and most
of the times it locks all the machines.
I have been...
|
by: Nkagi |
last post by:
Hi All,
I have a problem of adding records into table, if the cursor is on the first
record the record that I add replaces the first record and then I moved it to
the last record and the new record replaces that last record in the table.
Is there a method that I can use to make sure this doesn't happen. The thing
is my program was working...
| |
by: Ron |
last post by:
Hi All,
Using Access2000, winXP.
Table 1 = tblClients displayed on frmClients via qryClients. 2nd table =
tblInvoices shown on frmInvoices via qryInvoices. 2nd table = tblDetails
shown on subform(to frmInvoices) sfrmDetails via qryDetails.
Relationship built between tblClients/tblInvoices/tblDetails by ClientID.
Relationship between...
|
by: Mustang97 |
last post by:
I've created a custom datagrid with a custom ado connection. Everything works perfectly except now I am trying to add a button that will add records. The way I know how to do that is with the commands
dim newdatarow as system.data.datarow
newdatarow = <dataset.name>.<table.name>.newrow
I put in..
newdatarow = db_ds.tbl_movdb.newrow
|
by: Bmack500 |
last post by:
I'm using the following subroutine. The two different XML files are
identical with the exception of three additional records in the second
one. One has 450 records, and the other has 453. After merging, I get
903 records. I guess what I expected was 3 records; just the
differences in the two.
The two tables have the exact same structure,...
|
by: Kristilee |
last post by:
I am working with an attendance database that holds records for each employee for when they are absent. For every 30 days WORKED for each employee I need to have the database automatically add a record. (it's an overly complicated attendance policy)
Can this be done with a query and SQL or will I have to code in VBA? I am not super proficient...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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. ...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
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...
|
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...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |