Question about Computers & Internet

1 Answer

How to add record in access database using ADODC connectivity in vb6

Posted by on

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

    Vice President:

    An expert whose answer got voted for 100 times.

  • Master
  • 981 Answers

Register with the major index or indices using your favorite ADO template, and use methods (.RecCreate, typically) on them to create a new record with some set of well-checked values; send an ADO heartbeat; enjoy.

Posted on Apr 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:

1 Answer

Describe your MicrosI use Adodc for connecting a database but how can i display records to listbox?oft Problem


Hello,
Yo have to bound the listbox to you Adodc controls. Let say's:

Assuming that you have already set you Adodc contrl to assign a connection in one of your database then use the code below to bound your listbox data source to your Adodc datasource.

Set Listbox1.datasource = Adodc1.datasource

Thanks

Aug 01, 2009 | Microsoft Visual Basic 6.0 for PC

1 Answer

I want to programaticaly modify an SQL statement in VB6


If I remember correctly you need to call ExecuteQuery or something similar otherwise it does not update the database.


Regards
GeWiz.

Jun 16, 2009 | Microsoft Visual Basic Enterprise Edition...

1 Answer

I have a visual basic program in which i have to display the record from access table by using connection of adodc.and then select record from datagrid will display in another form. plz reply as soon as...


hi,  you may visit this site www.kidwaresoftware.com/ and download all free visual basic source codes with tutorials..  One of the source code will solve your problem.    However their paid Visual basic source codes will most powerful.    As I am total deaf and no source to communicate others... I want to share the  payment source codes with tutorials from  www.kidwaresoftware.com/.  Are you ready... If you download the  source codes with tutorials (only Fee for it) I will share with you.    esakkisivaganesh@yahoo.co.in

Apr 08, 2009 | Microsoft Visual Basic Enterprise Edition...

1 Answer

How to connect vb with ms access


se Adodc OR Even better.. ADODB. for this you need to get MDAC fromMicrosoft free download.(check under project_References- Microsoft DataActiveX objects.. the current no is 2.8. if it is not there download invb directory.

next, you can learn about creating a DSN from control panel, ODBC. onceyou learn this, connection becomes a piece of cake. get some free vbtutoriasl from WWW.

then

you need to use DAO or ADO to connect to the database. better study both but since ADO is current, i am showing that code.
under Menu Project_References, put a check mark on Microsoft ActiveXData Objects latest version (though it works for all, currently 2.8with sp pack 1 ).

at the general declarations:
dim conn as adodb.connection, rec as adodb.recordset, esql as string,esql1 as string
Private Function connect()
Set rec = New ADODB.Recordset
Set conn = New ADODB.Connection
esql = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:VBDesigndhana2.mdb" & ";Persist Security Info=False"
'here you put the correct path of your mdb file. and check if you have jet 4.0

conn.Open (esql), , , 0
End Function

private sub form_Load()
connect
end sub
and for adding records:
say let us say you have 3 fields. then have 3 textboxes and 1 command button on the form.

private command1_click()
esql1="select * from Yourtablename"
rec.open(esql1),conn,, adOpenDynamic, adLockOptimistic
rec.AddNew
rec.Fields(0) = text1.Text
rec.Fields(1) = Text2.text
rec.Fields(2) = text3.text
' you need to check if in your access table design you have Allowed Zero length .. set it to Yes for all text fields.
rec.update
if not rec.eof then rec.movenext
rec.close
conn.close
set conn to nothing
end sub

this will add new records to access table from VB.
' for picture store the full path of the path and the picture file nameint the text field. and in the picturebox of VB form for viewingrecords again you need ADO or ADODC and here you code:picture1.picture=Loadpicture(rec.fields(3) ' depending on where thepicture field is located. you need to make a few trials.
under Menu Project_References, put a check mark on Microsoft ActiveXData Objects latest version (though it works for all, currently 2.8with sp pack 1 ).

at the general declarations:
dim conn as adodb.connection, rec as adodb.recordset, esql as string,esql1 as string

Private Function connect()
Set rec = New ADODB.Recordset
Set conn = New ADODB.Connection
esql = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "D:VBDesigndhana2.mdb" & ";Persist Security Info=False"
'here you put the correct path of your mdb file. and check if you have jet 4.0

conn.Open (esql), , , 0
End Function

private sub form_Load()
connect
end sub

and for accessing records:

private command1_click()
esql1="select * from Yourtablename where id =" & val(text1) ' for integers

esql1="select * from Yourtablename where name=" & "'" & text1 & "'" ' for string

rec.open(esql1),conn, adOpenstatic, adLockreadonly

label1.caption =rec.Fields(0)
label2.caption= rec.Fields(1)
label3.caption= rec.Fields(2)
' you need to check if in your access table design you have Allowed Zero length .. set it to Yes for all text fields.

rec.close
conn.close
set conn to nothing
end sub


' similarly there are routines to ADD, Delete, Edit, View etc.

Feb 26, 2009 | Computers & Internet

1 Answer

Write into excel format


Your code does not save in access format it just makes a copy of existing file. You need to open table by table and export data using csv format.
It can be done using access OLE to export, or
write some VB code to access the database tables via ODBC and save row data to csv file

Feb 17, 2009 | Microsoft Visual Basic Professional...

1 Answer

Migration from single machine to multiuser environment


have you made sure that the ADODC path points to the machine that holds the database on a remote path for example (\\ComputerName\c$\Data\) and that it isn't a local path. (C:\Data\)

Dec 15, 2008 | Microsoft Windows Server Standard 2003 for...

1 Answer

Data storage form


If you give me a bit more detail about what you're trying to do, I would be happy to help.

I think you are interested in building a form that will add records to a database. Am I correct?

Tell me the language you are using, and the type of db. I know you are interested in SQL, but perhaps you are using Access.

If I guessed you are trying to create a web form that adds records to a database would I be correct?

The more detail you can offer, the more I can be of help.

Best Regards,

airoff (Alan)

Jul 17, 2008 | Microsoft Windows Server Standard 2003 for...

1 Answer

Accessing data


Dear reader

Place an ADODC control on your form in VB.
In the properties of the ADODC control goto the TAB General.
click "Use Connection String. With the button Build you can point to your database.
Thats it.

With the following code you can connect to db:

With Adodc
.RecordSource = "SELECT * From YOURTABLE"
.Refresh
End With

Now you have the table in the adodc control.

you can now do this:

Label1.caption = Adodc.Recordset!YOURFIELD

YOURTABLE = the name of your table in the database.
YOURFIELD = the fieldname in YOURTABLE you want to show.

Kind regards Fred.

Jul 04, 2008 | Microsoft Office Access 2003 (077-02871)...

1 Answer

To fix the page layout to


Oomar,

Using Word with VB6, I show how you set the page size to A5:

Sub AutomateWord()
' Declare the variable.
Dim objWD As Word.Application
' Set the variable (runs new instance of Word.)
Set objWD = CreateObject("Word.Application")
' Add a new document.
objWD.Documents.Add
' Add some text.
objWD.Selection.TypeText "This is some text."
'Set Page Size
objWD.ActiveDocument.PageSetup.PaperSize = wdPaperA5
' Save the document.
objWD.ActiveDocument.SaveAs FileName:="mydoc.doc"
' Quit Word.
objWD.Quit
' Clear the variable from memory.
Set objWD = Nothing
End Sub

Hope this helps!

Mar 18, 2008 | Computers & Internet

1 Answer

RUN TIME ERROR 2147217842(80040e4e)


have u check the net framework version of the os ur using

Dec 18, 2007 | Computers & Internet

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

Related Topics:

68 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

100174 Answers

David Payne
David Payne

Level 3 Expert

14160 Answers

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

Answer questions

Manuals & User Guides

Loading...