Hi there,
currently I am trying to get some basic experience with VB6
I was able to make a connection with MS Access already, so I made a form and made use of a ADO DC. Now I can see trough all of the records from that Table in the Database. Now am I trying to make it possible, to create new records using the Form in VB. So I made a Command button, tried some stuff and got stuck.. I have absolutely no clue on how to make a new form, that's why I am posting this here.
Thanks
~F3dde
6 2210
Hi there,
currently I am trying to get some basic experience with VB6
I was able to make a connection with MS Access already, so I made a form and made use of a ADO DC. Now I can see trough all of the records from that Table in the Database. Now am I trying to make it possible, to create new records using the Form in VB. So I made a Command button, tried some stuff and got stuck.. I have absolutely no clue on how to make a new form, that's why I am posting this here.
Thanks
~F3dde
would u Plz Describe in details.if possible show me the code also
Hi there,
currently I am trying to get some basic experience with VB6
I was able to make a connection with MS Access already, so I made a form and made use of a ADO DC. Now I can see trough all of the records from that Table in the Database. Now am I trying to make it possible, to create new records using the Form in VB. So I made a Command button, tried some stuff and got stuck.. I have absolutely no clue on how to make a new form, that's why I am posting this here.
Thanks
~F3dde
Hey there, f3dde!
As mentioned, it's a bit unclear as to what you hope to achieve, but I seem to have picked up some hints. Sounds like you can see your database through ADODC but cannot add to your databse. If this is the case, I suggest you keep searching this forum. You may stumble upon notes on the very issue of adding/reading your data to/from database. Please let us know where you are, have a code added in this forum to have a look.
I wish you luck with the project.
In a bit!
Dököll
Hey there, f3dde!
As mentioned, it's a bit unclear as to what you hope to achieve, but I seem to have picked up some hints. Sounds like you can see your database through ADODC but cannot add to your databse. If this is the case, I suggest you keep searching this forum. You may stumble upon notes on the very issue of adding/reading your data to/from database. Please let us know where you are, have a code added in this forum to have a look.
I wish you luck with the project.
In a bit!
Dököll
I am able to see my database trough the ADODC. It looks just like the form in Access now. I just want to be able to edit it in the VB form now, which I am not able to do yet. In other words. I'm trying to find out how to code the Command-buttons in order to make a new record. I hope this makes it more clear to you.
I am able to see my database trough the ADODC. It looks just like the form in Access now. I just want to be able to edit it in the VB form now, which I am not able to do yet. In other words. I'm trying to find out how to code the Command-buttons in order to make a new record. I hope this makes it more clear to you.
You then will need to query your database, like an update statement. You're comfortable typing up a query!
The code you have to read your database can be modified to update...Post what you ahve working, we'll piece it together. How's that for a deal?
- Option Explicit
-
-
Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
-
Adodc1.Caption = Adodc1.Recordset.AbsolutePosition & " van " & Adodc1.Recordset.RecordCount
-
End Sub
-
-
Private Sub Form_Load()
-
Adodc1.Caption = Adodc1.Recordset.AbsolutePosition & " van " & Adodc1.Recordset.RecordCount
-
End Sub
That is what I currently have, and I suppose this is what you meant. Hope you can help me
Alright. Since I've had a critical error which made me delete the whole thing I had to start over again, and because I can't find a way to edit my post I made this new reply.
I had to edit my code, because I was unable to get it to work again using the code I posted earlier.
Currently my code looks like the following: -
Option Explicit
-
-
Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
-
Adodc1.Caption = Adodc1.Recordset.AbsolutePosition & " van " & Adodc1.Recordset.RecordCount
-
End Sub
-
-
-
Private Sub Form_Load()
-
Dim strVerbinding As String
-
strVerbinding = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\bibliotheek uitleensysteem.mdb"
-
With Adodc1
-
.ConnectionString = strVerbinding
-
.RecordSource = "SELECT * FROM Boek"
-
.Refresh
-
End With
-
-
With txtID_Boek
-
Set .DataSource = Adodc1
-
.DataField = "ID_Boek"
-
End With
-
With txtISBN
-
Set .DataSource = Adodc1
-
.DataField = "ISBN"
-
End With
-
With txtAuteur
-
Set .DataSource = Adodc1
-
.DataField = "Auteur"
-
End With
-
With txtTitel
-
Set .DataSource = Adodc1
-
.DataField = "Titel"
-
End With
-
With txtRubriek
-
Set .DataSource = Adodc1
-
.DataField = "Rubriek"
-
End With
-
With txtUitleenbaar_in
-
Set .DataSource = Adodc1
-
.DataField = "Uitleenbaar in"
-
End With
-
End Sub
-
This is pretty much the same thing exept for the ADO DC, which doesn't show me what I wanted. - Adodc1.Caption = Adodc1.Recordset.AbsolutePosition & " van " & Adodc1.Recordset.RecordCount
That is what I am using to show me where I am at the navigation. It should show me: "Current book" from "Total amount of books", but for some reason it doesn't refresh and so is behind all the time.
I'm also still trying to find a way to make new records true this form. By looking at some other help sites I've started to think I need to create a "Recordset", which also is a mystery for me.
I hope this update was clear for you, so you can help me.
~F3dde
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Graheme |
last post by:
Hi, couple of questions from a newbie:
First, I have a database with basically 3 tables:
Customer, which has cust#, name and address;
Items which has cust#, type, serial# and description;
Items...
|
by: N. Graves |
last post by:
Hello... thank you for your time.
I have a form that has a List box of equipotent records and a sub form
that will show the data of the equipment select from the list box.
Is it possible to...
|
by: uv |
last post by:
Hi!
I'm having problems submitting a new record through the form.
I'm working with the wizard and I've added a control button to my form
for entering entering a new record but for some reason it...
|
by: uv |
last post by:
Hi!
I'm having problems writing new records into the dtatabase as well as deleting.
I have tried doing so by adding the control buttons to a form.
Unfortunately I'm only succesful in creating the...
|
by: svdh2 |
last post by:
Dear All,
I have lately strugled more and more with Access, what started as a
simple database has brought me to the fundaments of Access.
I need to transfer fields from various tables to a...
|
by: Kenjamin.Lafayette |
last post by:
Here is the scenario. I have a list of people, what building they work
in, and on what days.
Is there a way in access to pull up this database and have it make a
list based only on the days,...
|
by: MarkNeumann |
last post by:
I'm coming from a Corel paradox background and moving into an Access environment. So I'm struggling with something that I think is probably way simpler than I'm making it out to be.
Access 2007...
|
by: Fred Ho |
last post by:
I have a form with several text boxs ( for several fields of records
information)hoping that user input at least one of the information to any of
the field in the form and it will search the data...
|
by: Doug |
last post by:
What is the simplest way to make a report where only the records
where a field matches a certain date are included, and the user first
selects that date (from form or popup)? (I can write the SQL...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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,...
| |