Skip to content

Database

Discussions on database access, SQL, and ADO

This category can be followed from the open social web via the handle database@forum.codeproject.com

17.1k Topics 61.8k Posts
  • ADO Errors

    c++ database sql-server sysadmin help
    5
    0 Votes
    5 Posts
    8 Views
    _
    I do use exception handling, thats from where a try to get the ado-errors. The problem is not catching the error but that the description field is NULL. I can get the HRESULT, native error,.. but that are not very friendly messages. I dont think the code that tries to dig out the error is to blame here, the problem must lie somewhere else,.......and i dont have a clue where. :( /Magnus
  • XML Support in SQL Server - does ANYONE use it?

    help database sql-server sysadmin xml
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Firehose mode error

    help sharepoint database sql-server sysadmin
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • 0 Votes
    1 Posts
    1 Views
    No one has replied
  • Identity Columns

    question
    2
    0 Votes
    2 Posts
    4 Views
    R
    The Identity column generates a unique identifier for you, therefore you do not need to worry about generating a unique identifier? This is suitable when you require a unique identifier !!!
  • MDAC installation check

    c++ question
    3
    0 Votes
    3 Posts
    4 Views
    R
    use this code on ::InitInstance CLSID clsid; HRESULT hr = AfxGetClassIDFromString("Datalinks", &clsid); if(!SUCCEEDED(hr)) { AfxMessageBox("You need to install MDAC v2.1 or higher"); return FALSE; } :cool:
  • Problems with ODBC and MSACCESS

    c++ database debugging help question
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • What are SQL or MSDE best practices for connections

    database question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • 0 Votes
    2 Posts
    4 Views
    C
    Highlight the table and select All Tasks -> Export. This will bring you into DTS. Select the Source and then the Destination (in this case they will be the same). Select Copy Table(s), hit next, select the table you want from the source drop-down and then type in a name for the destination table. You can use Transform here to manipulate the fields, etc. Hit Next, you can run this imediately or save in which you can call this DTS Package from a Job, Stored Procedure, etc. (See BOL about calling DTS packages from an sp.) Another way: Select * into (new_table_name) from (old_table_name) This will create a new table with all the info. (NOTE: This 'transfer' is not logged as a transaction, thus can not be rolled back. I believe you can check FULL RECOVERY on you DB and this will correct this.) Good Luck!
  • Access 2000

    database c++ question announcement
    4
    0 Votes
    4 Posts
    7 Views
    C
    The question was, "How do I make it work on any Win 9x or 2000 machine?" For this, you will always need MDAC. The newest version (with patches) is not the one that was distributed with Win2K, but has been since updated. CodeGuy http://groups.yahoo.com/group/wtl
  • ADO bug in VC++ 6 SP5 + Processor Pack

    c++ help question sharepoint debugging
    2
    0 Votes
    2 Posts
    4 Views
    R
    your code where you have throw "a"; looks well dodgy !!!! maybe you should remove that :cool:
  • Reading Fixed Width Files with ADO?

    database xml question
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • select * from multiple tables??????

    database tools tutorial question
    6
    0 Votes
    6 Posts
    8 Views
    C
    Is the same Select Company.*, email.email, phone.phone FROM Company LEFT JOIN email ON Company.ID = email.companyID AND Company LEFT JOIN phone ON Company.ID = phone.companyID If the phone or the email for that company don't exist, you will see the field like NULL. Cheers!!!! Carlos Antollini.
  • Database Development

    database design question
    3
    0 Votes
    3 Posts
    6 Views
    L
    IMHO, PostgreSQL is the best thing out there. It basically kicks arse on all the other free RDBMSes and the vast majority of commercial offerings. I have recently started using MS SQL server at work and I must say, Postgres compares very favourably. http://www.postgresql.org You'd have to be pretty hard core to wanna get into this source code :)
  • Field Existence with ADO

    database algorithms help
    2
    0 Votes
    2 Posts
    4 Views
    R
    use the FieldsPtr class e.g. FieldsPtr ptrFields = NULL; FieldPtr ptrField = NULL; // assign the Fields that we have from the recordset ptrFields = m_pRS->Fields; int nCols = ptrFields->Count; FieldPtr ptrField = NULL; _variant_t vCol((long)-1); for (int i = 0; i < nCols; i++) { vCol.lVal = i; HRESULT hr = ptrFields->get_Item(vCol, &ptrField); if(FAILED(hr)) _com_issue_error(hr); // now check if the field exist if ((LPCSTR)ptrField->Name == "My Field") { // Do Something } } :cool:
  • ATL OLEDB Template Insert

    c++ database wpf tutorial learning
    3
    0 Votes
    3 Posts
    5 Views
    B
    I checked further today. The open statement fails when I have the insert, update or delete property set, but works when opened for reading. I am using the Oracle OleDB driver from Microsoft. I'm wondering if it is a Read-Only driver???? Brad
  • 0 Votes
    2 Posts
    4 Views
    R
    You need to change the parameter declaration in your stored procedure .. DECLARE @file_id int OUTPUT, .. This will then return the value for you when you execute the code via ADO. One thing to remember is that you will need to close your recordset down before you can read the value. This is only if you are not also returning a recordset :cool:
  • OLE DB/ATL guides worthless

    database question c++ csharp visual-studio
    2
    0 Votes
    2 Posts
    4 Views
    N
    Just like with anything the wizards are a good start, but you must be able to add to what has been provided. The ATL OLE DB wizard only works with one table soyou will have to hand code the Accessor to provide for the additional tables.
  • Select DISTINCT and CRecordSet

    database question
    5
    0 Votes
    5 Posts
    8 Views
    C
    Yes, You don't have problem with that. You only need to use the open method in your class. Your class is derived from the CRecordset class, is for this that you don't have problem. Cheers!!! ;) Carlos Antollini.
  • MS Access Field List Disappeared

    help database tutorial question
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied