Hi! My database is in AS/400 DB2 hence, I am using SQL. Here's my line of code for opening a connection. Dim str As String = "User ID=EDITH;Password=EDITH;Data Source=10.0.1.11;Initial Catalog=ictms;Integrated Security=True" Dim conn As SqlConnection = New SqlConnection(str) conn.Open() Now, I wanted to execute a delete query, however, I already get errors in the `conn.Open()` area. Please check the attached file for the error.

Member Avatar
Member Avatar
+0 forum 29

I am trying to connect a Crystal report to my database.mdf i.e SQL Server database. When using the wizard At the [I]Database Expert[/I] window after choosing the [I]OLE DB (ADO) [/I]i can not find any server and a database in the drop down menu. how to get that? i have tried viewing tutorials. I have also restarted the SQL Service from the configuration manager.:sad:

Member Avatar
Member Avatar
+0 forum 2

hi, I need a help.how can i SEARCH a record in a database using listbox and display the results?? For an example: if i select a destination on the listbox and it will look for the records on database and display it. im using ms access and adodb connection.Below is my coding for my program Dim con As New adodb.Connection Dim r As New adodb.Recordset con.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\db4.accdb;" r.Open "SELECT Destination FROM tblFare , con, adOpenDynamic, adLockOptimistic, adCmdTex" If r.BOF = True Or r.EOF = True Then Label7.Visible = True Exit Sub Else Text8.Text = r!Destination …

Member Avatar
Member Avatar
+0 forum 2

Add the snippet in your module. **Requirements:** * Make sure you have reference to M$ ActiveX Data Objects Library (ADODB) * A table field with OLE Object / BLOB as datatype * A recordset that is already oppened and ready to be use **To save Image on your table field, call `SetRSBlob` function** Make sure that your **recordset is already loaded or openned** Lets assume that our recordset `rs` is already oppened and ready to be updated. Dim ret as Boolean ret = SetRSBlob("C:\image1.jpg", rs, "image") TRUE will be returned if image was set to the recordset field. All you …

Member Avatar
+1 forum 0

Hi Guys, is there a Code snippet which allows me to check if a certian ADO Connection has been setup on a clients Local machine and if not then disable certian Radio buttons? The reason I ask is I have a 'Read-Only' Connection to a DB (Don't ask.. that's all the 3rd Party will give us access to). Some of the local machines will not have the program installed (hence the ADO connection won't exisit) Any adivce would be great. Kind regards Mark.

Member Avatar
Member Avatar
+0 forum 1

i have a problem when updating database. i need to update stock value in other table and count it and update to another table again. here the code : 'in every row on 'SalesDetailBindingSource' For Each SalesDetailData In SalesDetailBindingSource MsgBox("SalesDetailData : " & SalesDetailBindingSource.Count) 'dim use to take parameter Dim SalesDetailDataRow = CType(CType(SalesDetailData, DataRowView).Row, myDataSet.SalesDetailRow) Dim paramTransactionNumber = TransactionNumberTextBox.Text 'parameter need : (paramProductId) Dim paramProductId = SalesDetailDataRow.ProductId 'row to find in table 'SalesDetail' Dim SalesDetailRow As myDataSet.SalesDetailRow SalesDetailRow = myDataSet.SalesDetail.FindByTransactionNumberProductId(paramTransactionNumber, paramProductId) 'in every row found For Each SalesDetailRowToFind In SalesDetailRow.Table.Rows 'here is the problem (i think) 'update to 'Stock' table …

Member Avatar
Member Avatar
+0 forum 1

Hi guys... I have a radio button that one checked will connect to an ADO Connection. The following code being used is: private void radioButton3_CheckedChanged(object sender, EventArgs e) { //Fields Disabled until a new Account is created.// txtAccRef.Enabled = false; txtAccName.Enabled = false; txtAccAddr1.Enabled = false; txtAccAddr2.Enabled = false; txtAccTown.Enabled = false; txtAccCounty.Enabled = false; txtAccPostCode.Enabled = false; //Buttons Disabled as not needed// btnNewCashAcc.Enabled = false; btnEditCashAcc.Enabled = false; btnSaveCashAcc.Enabled = false; btnDeleteCashAcc.Enabled = false; //As Data is being pulled from Line 50 this fields have cleared.// txtAccRef.Clear(); txtAccName.Clear(); txtAccAddr1.Clear(); txtAccAddr2.Clear(); txtAccTown.Clear(); txtAccCounty.Clear(); txtAccPostCode.Clear(); //Opens the Line 50 Connection// adoConn.Open("SageLine50v19", …

Member Avatar
Member Avatar
+0 forum 4

Hi Guys, Is there a best practise when having an ADO connection to speed up the process? Currently the method I am using below works fine but it's a little slow in getting the data. Is there any hints, tips or tricks I can utilise to speed this up? //Opens the Line 50 Connection// adoConn.Open("SageLine50v19", "Manager", "", 0); //Creates new versions of the Connection string and Data Set// da = new OleDbDataAdapter(); ds4 = new DataSet(); if (File.Exists("C:\\twDB.xml")) { //Create a new Datatable called "accountsTable" and then adds that the the DataSet 4// DataTable accountsTable = new DataTable("accounts"); ds4.Tables.Add(accountsTable); //SQL …

Member Avatar
Member Avatar
+0 forum 5

I am working with sql server using ADO provider. My code uses recordsets and commands to run quries and I fail to understand a basic issue - connections. In my code, they set a connection string (which is being built in the code, not taken from other ADO element) to the property "connectionString" and call the Open (for recordSet) or Execute (for command) and it seems to work. My question is who manages the connection? who opens it and closes it? Does setting connection string to the ADO recordSet / command automatically open a connection? and does calling the Close …

Member Avatar
Member Avatar
+0 forum 1

I'm really new in ADO for just a substitution on Data Control (I cannot dl any access 2003 D:) --- Whenever I enter command3, it says: *Compile Error: Method or data member not found* and the highlighted one was **.EOF** Code: Private Sub Command3_Click() Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find "SID = '" & Text1.Text & "'" If Adodc1.EOF Then MsgBox "Not found" === All opinions are appreciated, I'll just try them one by one. I'm just a student, and this ADO thingy didn't teach us in school so I just need some help for our project :D

Member Avatar
+0 forum 0

Hi I have a big (working) software written in C++ that uses SQL database, using the ADO interface. I'm currently using old ADO libraries (prior to the Windows7 SP1 problem) and wish to upgrade. I'm considering taking advantage of this need and upgrade to ADO.NET. What do you think?

Member Avatar
Member Avatar
+0 forum 1

Hi Guys, I'm currently working on a small item that I hope you will be able to help with. I have used an example Code to get connected to 'Sage Line 50' data and it seems to work correct. Currently it populates the Combo Box with the Database Scheme and from there depending on what is selected will show the contents of the table in the List View. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace SageConnection2012 { public partial class Form1 : Form { private ADODB.Connection adoConn = new ADODB.Connection(); …

Member Avatar
Member Avatar
+0 forum 1

Good day! I just want to ask on what is the best ADO connection string to connect to MS Access fast? and what is the fastest way to create it? And also, where in the project to best put it so that all forms in the project will use it without closing the connection. I also need to create a recordset from it.. Thank you!

Member Avatar
Member Avatar
+0 forum 12

Sometimes sorting data can be easy and sometimes it can be difficult. If you have data in a listview you can spend a great deal of time writing ICompare functions. This is appropriate for non-trivial applications but can be a little intimidating for inexperienced programmers. Also, it is a problem where the format of the input data changes. Detached recordsets provide a method which allows ad hoc sorting of data. With a little planning, they can be used to provide sorting for data where the number of fields is not known until runtime. Once you get the "messy" stuff out …

Member Avatar
Member Avatar
+1 forum 1

I have an application that is writen in PHP and connects to a MS SQL Server 2008 Database. I'm using ADO recordsets. There are cases where specific IDs and years in the table returns nothing. How do I test for when there are no results? I searched and most of the results are when using MySQL but I'm not using that. Here's a sample of my code: $myServer = "localhost"; $myUser = "user"; $myPass = "password"; $myDB = "myDatabase"; //create an instance of the ADO connection object $conn = new COM ("ADODB.Connection") or die("Cannot start ADO"); $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; //define …

Member Avatar
Member Avatar
+0 forum 2

Hi i'm unable to do multiple update (using Ms Acess because of restrictions). I try to do through ADO method (also because of restriction , x ODBC). The operation will break when reaching the script to update on the second page. Can you guys point where did i went wrong? [B]1st page:[/B] [CODE]<?php $db_conn = new COM("ADODB.Connection"); $connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("./dbExam.mdb").";"; $db_conn->open($connstr); $rS = $db_conn->execute("SELECT * from BC101"); $f1 = $rS->Fields(0); $f2 = $rS->Fields(1); $f3 = $rS->Fields(2); $f4 = $rS->Fields(3); $f5 = $rS->Fields(4); $f6 = $rS->Fields(5); $f7 = $rS->Fields(6); $f8 = $rS->Fields(7); $f9 = $rS->Fields(8); ?> …

Member Avatar
Member Avatar
+0 forum 1

Hello guys. Just wanna know how you could add item to a vb 6 list box or combo box that is bind to a database? I.e. Ado oledb. Let say i have 1 text box wherein every time i input a data to it. It would be added to a list box or combo box item which item in return would be added to a database. And each data item in the list box or combo box could also be deleted or edited. And any duplicated date would not be accepted by the list box or combo box in upper …

Member Avatar
Member Avatar
+0 forum 1

I have been fighting with this all day and looked at so much documentation and other posts I think I am going blind. I can't find an answer that works. I am trying to read through a set of records until the reference number changes and then return to the first record with that reference number to do some calculations. I want to continue to loop through the record set until I have touched each record twice and written out each record once. I am using the ADO .find to return to the first record with the reference number and …

Member Avatar
Member Avatar
+0 forum 3

Hi there, Currently I am making an payroll system using VB6. There is a form where it is used as a search form. We will input the name in the search bar. So what I want to ask is that, is it possible that without clicking the search button and by just inputting a single letter like "A" the whole records with "A" will appear instantly, just like in google. when you type a single letter, names or data already appears below. Is it possible to do that in VB6? By the way I will be using an ADO data …

Member Avatar
Member Avatar
+0 forum 1

hello everyone i have this error saying "requested operation requires ole db session object which is not supported by the current provider"..i wonder why this appears.i am using an ado and using vb6..can someone enlighten me with this problem..thanks

Member Avatar
Member Avatar
+0 forum 2

Hi all, I am trying to produce a basic till system, and at current am using an ADOquery to bring up the items ordered along with their relevant prices in a DBGrid. What I now need to be able to do is use the price values contained within the DBGrid to work out the total cost of the bill (i.e. I need to be able to sum all the prices in the DBGrid) and then ouput this total cost to a label or edit box when I click on a button. I hope that this is possible and that one …

Member Avatar
Member Avatar
+0 forum 1

I have a legacy VB6 application; simple VB6 front end and Access backend database. Works fine on Win 2000, WinXP, Vista, and 32-bit Win7. Bought a new laptop and everything seems to be shipping with 64-bit Windows now. Out of the box, the application worked fine after I manually re-registered a couple of the OCX's for controls. Then Windows went out and did an automatic update of windows, and Microsoft obviously replaced the ADO (Active Data Objects) library, which is where the code is for accessing various databases. The internet is littered with posts about how the newer ADO library …

Member Avatar
+1 forum 0

Problem is based on C#, ADO.NET, using Access Database. I am trying to filter the results from the database and display them in DataGridView on click of 'button1' button. But the datagridview shows empty results when there are actually 3 records with matching conditions. According to what I know, the SQL statement is right, I am not able to find what mistake I am making. I have attached the whole project and database, problem is in dispAndEdit form.

Member Avatar
Member Avatar
+0 forum 10

how to add record into my database mysql

Member Avatar
Member Avatar
+0 forum 19

First, sorry for posting this here, but I couldn't find a VBScript forum on Daniweb (which I find surprising). I'm working with binary data in several different projects. Below is an example of code that works to retrieve a static map image (PNG) from Google: [CODE]strFileURL = "http://maps.google.com/maps/api/staticmap?markers=2200+S+Western+Ave+Lisle+IL&zoom=14&size=400x400&sensor=false" Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP") Set objFSO = Createobject("Scripting.FileSystemObject") objXMLHTTP.open "GET", strFileURL, false objXMLHTTP.send() If objXMLHTTP.Status = 200 Then Set objADOStream = CreateObject("ADODB.Stream") objADOStream.Type = 1 'adTypeBinary objADOStream.Open objADOStream.Write objXMLHTTP.ResponseBody objADOStream.Position = 0 Set tempfolder = objFSO.GetSpecialFolder(2) tempname = tempfolder & "\" & objFSO.GetTempName If objFSO.Fileexists(tempname) Then objFSO.DeleteFile tempname objADOStream.SaveToFile tempname objADOStream.Close Set …

Member Avatar
Member Avatar
+0 forum 6

how do I link ADO data control with a protected access database ???

Member Avatar
+0 forum 0

Hi all, I'm writing an application that imports and tidy up address data into a cleaned, deduped excel workbook ordered in rows with each column as an address field. One of the issues I've ran into is that we sometimes get a workbook where the multiple address fields are held in a single cell with line breaks. I've written code to extract all of this data out of the excel sheet in to a dataset with each sheet as a table and the address fields contained within. I now want to create a new Excel workbook from this data with …

Member Avatar
Member Avatar
+0 forum 2

I've been working on getting a SQL DB to return records through an ADODB.Connection object and have had zero luck getting it to work in VB6. Whereas I created an ASP form using VBS to produce the exact same functionality with no issues. In VB6, I've included the following references: Visual Basic for Applications -Visual Basic Runtime objects and procedures -Visual Basic objects and procedures (dupe of the above?) -OLE Automation -Microsoft ActiveX Data Objects 2.1 Library DO I also need to include Microsoft Active Server Pages object Library and/or Microsoft Active Server Pages ObjectContext Object Library? This is what …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am new to this website (and C++) so pls forgive any newb errors / convention mistakes. I have a project that contains both a normal source file (PB.cpp), associated header (PB.h) and a windows form (GUI.h). I'm trying to pass a variable from the form to a function in PB.cpp but i get the error: c:\bot\pb\pb\GUI.h(419): error C2660: 'funcdec' : function does not take 1 arguments A simplified version of the problem is below: [U]PB.h:[/U] [CODE]int funcdiv();[/CODE] [U]PB.cpp:[/U] [CODE]#include "stdafx.h" #include <iostream> #include "GUI.h" using namespace std; using namespace System::Drawing; using namespace PB; int funcdiv(int x) { int …

Member Avatar
Member Avatar
+0 forum 3

Hi, I have a little problem with a macro I'm working at. I need to pull data from a database and then show it in an excel sheet. Everything work fine till the moment when I want to close the recordset . Then my application freezes and I have to kill the process from Task Manager. Here is the code [CODE] Dim spBasicInfo As ADODB.Command Dim rsBasicInfo As ADODB.Recordset ... 'some code On Error GoTo err_place Set_Connection Set spBasicInfo = New ADODB.Command Set rsBasicInfo = New ADODB.Recordset With spBasicInfo .ActiveConnection = dbConnection .CommandType = adCmdText .CommandText = "Raport_contacte_ora" .CommandTimeout = …

Member Avatar
Member Avatar
+0 forum 1

The End.