VB6, Access97, canceling changes

ADO

    Next

  • 1. The type library wrapper tool 'tlbimp' cannot be found on this sys
    Whenever I try to add a reference to teh MS activex data object s library I get the following error: The referenced component 'ADODB' could not be found. The type library wrapper tool 'tlbimp' cannot be found on this system. Please re-install Visual Studio. I did a net search and found nothing useful bar something about changing languages which I have not done. Any help much appreciated, and yes I have tried re-installing both studio and XP Thanks Paul
  • 2. ADO vs. ADOX Column Field Discrepancy
    Hello People, I am using C++ with ADO 2.8 against MSSQL Server, MSDE and Access 2000, 2003. When I use ADOX to examine the properties of a Column, GetDefinedSize returns 0 for non-character fields. When I use ADO to examine the properties of a Column (via a recordset), GetDefinedSize is returning 'good' data. Examples ADOX (Table): "\t" << (long)oColPtr->GetDefinedSize() << [*]Name(prop); DataType; SizeDef ClientNum(1); adInteger; 0 *clientcode(0); adVarWChar; 25 ClientName(2); adVarWChar; 100 entitytypeid(3); adInteger; 0 ADO (Recordset): "\t" << (long)oFldPtr->GetItem(Index)->GetDefinedSize() << [*]Name(prop); DataType; SizeDef ClientNum(1); adInteger; 4 *clientcode(0); adVarWChar; 25 ClientName(2); adVarWChar; 100 entitytypeid(3); adInteger; 4 I do not see why there should be two different sets of values. Does anyone have any ideas? -V-
  • 3. Nested Transactions
    hello, I'm using VB6 and SQl2000 on WinXP. Now in an older program we used nested transactions. Trying this with ADO and SQLOLEDB, on the COMMIT resp. The Rollback doesn't work, saying , there is no corresponding BEGIN statement. But using ODBC, there was no problem. Cab anyone imagine, what could happen ? Yes, I've looked for BEGIN, COMMIT and ROLLBACK and the sequence, they are appearing. thanks Manfred
  • 4. Transaction cannot have multiple recordsets with this cursor type. Change the cursor type, commit the transaction, or close one of the recordsets
    Hi, I am connecting to a SYBASE database using an ADODB Connection from my VB code. In the code I am trying to execute a delete statement, a select statement and an update statement in the order in a transaction using a single connection object. I am getting the error "Transaction cannot have multiple recordsets with this cursor type. Change the cursor type, commit the transaction, or close one of the recordsets" when executing the code on some machines. On few machines, this code works perfectly well. Please find the code snippet I am using in my code: Dim strSQL1 as string Dim strSQL2 as string Dim strSQL3 as string Dim rs as ADODB.RecordSet Dim cnn1 as ADODB.Connection strSQL1 = "delete from Table1 where Column1 = 1" rs = New ADODB.Recordset ' The Table1 and Table2 are in the same database. cnn1.BeginTrans cnn1.Execute(strSQL1) strSQL2 = "select * from Table1" With rs .CursorType = adOpenForwardOnly .LockType = adLockReadOnly .ActiveConnection = cnn1 .Source = strSQL2 .Open If Not .EOF Then ' Do Something. End If .Close End With strSQL3 = "update Table2 set Column2 = 1" cnn1.Execute (strSQL3) cnn1.CommitTrans Does anyone know the reason/fix for the problem? Help! Thanks, Vijay
  • 5. retrieve id when adding a new record in SQL
    Hello, I adding a record to a SQL database. One of the columns in the database generates a uniquely identifying integer when a record is added. I would like to retrieve this number when I add a new record to the table. By the way I do not want to use stored procedures. I using the following VB.NET code to add a record to a database how would I change this so that at the same time I can retrieve the unique record id generated by the database in the table? Imports System.Data.SqlClient Dim conDB As SqlConnection Dim strInsert As String Dim cmdInsert As SqlCommand conDB = New SqlConnection("connection string") strInsert="Insert Products (ProdName,ProdCat) Values ('Flat Chair',hair" cmdInsert = New SqlCommand(strInsert, conDB) conDB.Open() cmdInsert.ExecuteNonQuery() conDB.Close() Thank you.

VB6, Access97, canceling changes

Postby Bruce Nicholson » Thu, 31 Jul 2003 04:09:31 GMT

I have a VB6 form with data bound text boxes.

If a user changes the contents of a field then cancels,
I would like to restore the old value and end without 
updating. It appears that recordset.resync is not 
supported by Access.

How should I proceed?
Is there sample code that demonstrates this type of 
action?



VB6, Access97, canceling changes

Postby Jay » Thu, 31 Jul 2003 06:39:47 GMT

I call the CancelUpdate method of the recordset. I am 
using bound controls but i bind them dynamically to an ADO 
recordset.

It should work even if you are binding the controls at 
design time.....

Jay


Return to ADO

 

Who is online

Users browsing this forum: No registered users and 51 guest