Question about Microsoft Windows XP Professional

1 Answer

Property management system

How can we connect adodb in visual basic 6.0?Can you give us some codes in searching?

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.

    Brigadier General:

    An expert that has over 10,000 points.

  • Master
  • 10,406 Answers

Nice try! Find an upper-class student to give you one-on-one tutoring with your homework.

Posted on Dec 02, 2009

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

Can give an example of search command code?in visual basic 6.0


If you click on the following link you will find tutorial of Visual Basic and You will als so find example commands including some examples for parameter searches http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/109244

hope it helpss rick

May 18, 2011 | Computers & Internet

1 Answer

How to connect MS access in the visual basic?


This following code to connect vb 6 with access
place this code in module :
vb Syntax
  1. Global Conn As ADODB.Connection
  2. Global rs As ADODB.Recordset
  3. Sub Access_Connector()
  4. Set Conn = New ADODB.Connection
  5. Conn.Provider = "microsoft.jet.oledb.4.0"
  6. Conn.CursorLocation = adUseClient
  7. Conn.Open App.Path & "\SIS.mdb"
  8. End Sub
Below link might help you... http://www.functionx.com/vbaccess/Lesson01.htm

Please rate or vote me , if you like solution..

Thanks
sandeep

Mar 15, 2011 | Computers & Internet

1 Answer

How to use adodb connection in visual basic version 6?


To use Connection String, we have to set the Connection String to a valid Connect String and then calling the Open method we can open the Connection by passing the connection string as first argument. Now a command object is created with Record set Open method that is given as argument. Then command is executed by command.Execute metod and resulting amswer is saved in recordset created.

Jun 28, 2010 | Microsoft Step by Step Visual Basic 6.0...

1 Answer

Saving the info that i entered in my visual basic in microsoft access.. how to code the save???


check this out
Rst.Open "users", strConnect, , , adCmdTable With Rst .AddNew .Fields("username") = txtname.Text .Fields("User_Password") = txtpws.Text .Fields("Access_Type") = cmbUserTypes.Text .Fields("Date_Created") = Now .Update End With Rst.Close

'#### connection to databas
Public connConnection As New ADODB.Connection Public rsRecordSet As New ADODB.Recordset Public rsRecordSet1 As New ADODB.Recordset Public Rst As New ADODB.Recordset Public Rst1 As New ADODB.Recordset Public Rst2 As New ADODB.Recordset Public Rst3 As New ADODB.Recordset Public strConnect As String Public ConnectionOk As Boolean


Public Sub ConnectionMOd() Dim strProvider As String Dim strDataSource As String Dim strDataBaseName As String Dim i As Integer On Error GoTo ErrorTimer strProvider = "provider=Microsoft.Jet.OLEDB.4.0;" strDataSource = App.path ' strDataBaseName = "Z:\database.mdb" ' strDataSource = App.Path strDataBaseName = "\database.mdb" strDataSource = "Data Source= " & strDataSource & strDataBaseName strConnect = strProvider & strDataSource
Set connConnection = New ADODB.Connection connConnection.CursorLocation = adUseClient connConnection.Open strConnect
Set Rst = New ADODB.Recordset Rst.CursorType = adOpenStatic Rst.CursorLocation = adUseClient Rst.LockType = adLockOptimistic ' adLockOptimistic
Set Rst1 = New ADODB.Recordset Rst1.CursorType = adOpenStatic Rst1.CursorLocation = adUseClient Rst1.LockType = adLockOptimistic
Set Rst2 = New ADODB.Recordset Rst2.CursorType = adOpenStatic Rst2.CursorLocation = adUseClient Rst2.LockType = adLockOptimistic Set Rst3 = New ADODB.Recordset Rst3.CursorType = adOpenStatic Rst3.CursorLocation = adUseClient Rst3.LockType = adLockOptimistic ConnectionOk = True Exit Sub ErrorTimer: MsgBox "Error Connecting To DataBase Please Check Network path", vbCritical, "Connection Error" End End Sub

Jan 08, 2010 | Microsoft Visual Basic Enterprise Edition...

1 Answer

Example sorurce code for database


Hello my friend try this code: This code is design for Visual Basic 6.0
Function for Connection and recordset string.  '========Connection String====== Public Sub connection(ByRef dConnection As ADODB.connection, ByVal dLocation As String)     dConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dLocation & ";Persist Security Info=False;" End Sub '======End of Connection String======
'=======Recordset String=========== Public Sub recordset(ByRef sRecordset As ADODB.recordset, ByRef sConnection As ADODB.connection, ByVal sSQl As String) With sRecordset .CursorLocation = adUseClient .Open sSQl, sConnection, adOpenKeyset, adLockOptimistic End With End Sub '======End Recordset String========
How to apply the above function? Application:
'====== Command Save Button======== Private Sub cmdsave_Click() Dim cn3 As New ADODB.connection Dim rs3 As New ADODB.recordset
Call connection(cn3, App.Path & "\CASGC.mdb") Call recordset(rs3, cn3, "Select * from Debtor_Creditor_Account") Set dtglobal.DataSource = rs3.DataSource   
With rs3   .AddNew   .Fields("Code") = txtCode.Text   .Fields("Description") = txtDescription.Text   .Fields("Tag") = cbotag.Text   .Update   .Requery    End With   MsgBox "New Account has been Added", vbInformation   Set cn3 = Nothing Set rs3 = Nothing
End Sub '=======end of Command Save button=====
The advantage of using this code is setting your database connection is you have a reliable connection towards your database where ever you place your database you can you don't to remount you databse connection control. Also you are no longer need to use a ADO control or DAO control just copy the function and paste it in your coding area and call the function and you have now a working database and recordset connection string. 

For more details regarding how to apply this code just email me at this address: geo_jonas@yahoo.com to get more codes. thanks.. Please rate this Solution.

Jul 08, 2009 | Microsoft Visual Basic 6.0 for PC

3 Answers

Visual Basic and SQL


Hi,

Visual Basic 6.0 and MS Sql server 7 or 2000 are highly compatible with each other. VB.net is compatable with sql 2005 which is inbuilt as well.

Jul 07, 2009 | Microsoft Windows Vista Ultimate Edition

1 Answer

I can't add data in the database using vb


Hi,
The database can be any like oracle.

Two type of connection u can make.
One of such connection is ADODB

The code is like

Dim ors As ADODB.Recordset
Dim oconn As Connection
Dim Qry as String
dim Qry1 as string
Set ors = New ADODB.Recordset
Set oconn = New ADODB.Connection
Chk_selectall.Visible = False

oconn.Open "Provider=MSDAORA.1;" & "user id = " & Username & _
";password = " & Password & ";data source = " & Conn_string _
& ";Persist Security Info=True"

Qry = "insert into table1 values (100,'we')"

oconn.execute "Qry"

If u select any data then u ve to use
Qry1 = "select * from table1"

ors.open "Qry1",oconn

do until ors.EOF

msgbox ors(0) & "," & ors(1)

ors.movenext;

loop

Mar 17, 2009 | Microsoft Visual Basic 6.0 for PC

2 Answers

Hw to link database using visual basic


use adobc <------try this

dim rs as new adobc.recordset
dim cn as new adobc.connection

private sub xn()
cn.cursorlocation = aduseclient
cn.open "CONNECTION STRING" <------
end sub

private sub form_load()
call xn
if rs.state=adstateopen then rs.close
rs.open "select * from TABLENAME" ,cn, adlockstatic, adlockreadonly
if rs.recordcount > 0 then
set datagrid1.datasource = rs
end sub

Feb 12, 2009 | Microsoft Visual Basic 6.0 for PC

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

Not finding what you are looking for?
Microsoft Windows XP Professional Logo

Related Topics:

35 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2642 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18355 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

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

Answer questions

Manuals & User Guides

Loading...