Question about Computers & Internet

1 Answer

With adodc.recordset .add !fieldname=text1.text

Posted by on

Ad

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Governor:

    An expert whose answer got voted for 20 times.

    Corporal:

    An expert that has over 10 points.

    Mayor:

    An expert whose answer got voted for 2 times.

  • Contributor
  • 3 Answers

Kenapa poker saya tidak bisa di buka

Posted on Mar 13, 2011

Ad

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

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

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

×

Loading...
Loading...

Related Questions:

1 Answer

Write a computer program to change fahrenheit to centigrade


'Convert fahrenheit to centigrade
dim cent as int
cent = Val(Text1.Text) // Text1.text as your input
cent = cent - 32
cent = cent * 0.5556
Text1.Text = cent // Converted and changed the same textbox

Feb 21, 2014 | Microsoft Visual Basic 6.0 for PC

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

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

About EOF and BOF


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

Dec 18, 2008 | Computers & Internet

2 Answers

Vb code for automatic number change


You want the code for when you press enter in textbox it automatically change to 1.

I am typing C# code you can easly covert it to VB.Net code

make an event for key press for textbox
and write the followting code in the event
IF textbox1.text = ""
textbox1.text = "1"
End IF

I hope your problem will solve with this If need more assistance let me know. If your problem is solved then don't forget to make answer my thread.

Regards

Nov 17, 2008 | Computers & Internet

1 Answer

Am not able to add/ retrive data


Proper syntax is:
With rstTemp
.AddNew
!FirstName = strFirst
!LastName = strLast
.Update
End With

Do you have the ADODB library loaded?

While in "Code" view...menu/tools/references ... look for a check by "Microsoft ActiveX Data Objects x.xx..."

If you don't have ADO reference library then setting ADODB recordset won't work no matter what syntax you use.

Hint: try using Ctrl+J while you code. The library will show you available syntax as you type.

Jul 20, 2008 | Microsoft Windows XP Professional

1 Answer

To form a jumbled words


Using VB as an example

Dim intLength as Integer
Dim y as Integer
Dim arrOut( ) as String
Dim TempLetter as String
intLength=len(text1.text)
ReDim arrOut(intLength)
Randomize
dim boolDone as boolean ' flag to track unfilled positions

Write a loop that gets each letter from text1, then choose a random number from 1 to intLength

Get the existing letter, then put it into a different position in the arrOut, based on the random number. If something is in that position, try again:

for y=1 to intLength
tempLetter = mid(text1.text,y,1)
boolDone=false
do while boolDone=false
r =CInt(Int((y * Rnd()) + 1)) 'Get random # from 1 to length
if arrOut(r) ="" then 'see if spot has been used
arrOut(r) = tempLetter
boolDone = true
end if
loop
next 'get next letter in text1

text2.text=join(arrOut,"") ' concatenate arrOut, no delimiter.


Hope that helps.





Jul 16, 2008 | Computers & Internet

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

Export data in excel shld yoeet through VB


When i first figured out how to pull data from SQL and put the results in an excel file i referenced these two articles....
Reading and writing excel file using VB.NET (http://www.codeproject.com/KB/vb/Work_with_Excel__VBNET_.aspx)
Get the Values From DataBase and Stored into excell Sheet (http://www.codeproject.com/KB/vb/Getvaluesfromdatabase.aspx)

This is the code i ended up using.... (check out those links to see how you need to import the ms office excel reference file with visual basic)

Const stcon As String = "Provider=SQLNCLI;server=xxxxx;database=xxxxx;uid=xxxxx;pwd=xxxxx;DataTypeCompatibility=80"
Dim stSQL As String = "select * from scs_rate_class_money where irate_book = 124 and snew_used = 'U' and sclass = '2' and splan = 'T4' and sopt_code = 'F1'"
Dim cnt As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim fld As ADODB.Field
'Open the connection.
cnt.Open(stcon)

'Open the recordset.
With rst
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.Open(stSQL, cnt, ADODB.CursorTypeEnum.adOpenForwardOnly, _
ADODB.LockTypeEnum.adLockReadOnly , _
ADODB.CommandTypeEnum.adCmdText)
.ActiveConnection = Nothing 'Disconnect the Recordset.
End With
'Close the connection
cnt.Close ()
Dim exp As Export = New Export()
Dim xlApp As New Microsoft.Office.Interop.Excel.Application
Dim xlWBook As Microsoft.Office.Interop.Excel.Workbook = xlApp.Workbooks.Add(Microsoft.Office.Interop.Excel.XlWBATemplate.xlWBATWorksheet )
Dim xlWSheet As Microsoft.Office.Interop.Excel.Worksheet = CType(xlWBook.Worksheets(1), Microsoft.Office.Interop.Excel.Worksheet)
Dim xlRange As Microsoft.Office.Interop.Excel.Range = CType(xlWSheet, Microsoft.Office.Interop.Excel.Worksheet).Range("A2")
Dim xlCalc As Microsoft.Office.Interop.Excel.XlCalculation
Dim i As Short

'Turn off Excel's calculation.
With xlApp
xlCalc = .Calculation
.Calculation = Microsoft.Office.Interop.Excel.XlCalculation.xlCalculationManual
End With
'Write the fieldnames.
For Each fld In rst.Fields
xlRange.Offset(0, i).Value = fld.Name
i = i + 1
Next
'Populate the range.
xlRange.Offset(1, 0).CopyFromRecordset(rst)
'Close the recordset.
rst.Close()
'Make Excel available to the user.
With xlApp
.Visible = True
.UserControl = True
'Restore the calculation mode.
.Calculation = xlCalc
End With
'Release variables from memory.
fld = Nothing
rst = Nothing
cnt = Nothing
xlRange = Nothing
xlWSheet = Nothing
xlWBook = Nothing
xlApp = Nothing

Jan 03, 2008 | Computers & Internet

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

Related Topics:

56 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

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

Answer questions

Manuals & User Guides

Loading...