Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Ole db connecting problem

Ole db connecting problem

Scheduled Pinned Locked Moved Database
databasec++sql-servercomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lisoft
    wrote on last edited by
    #1

    dear all: I'm trying to use OLE DB to access the SQL Server instead of ODBC(MFC) which I was quite familar. Here is some simple codes I used to open data source: CString m_username,m_password; ... ... CDBProSet m_dbproset; m_dbproset.AddProperty(DBPROP_INIT_DATASOURCE,L"SQL_SERVER_HOSTNAME"); m_dbproset.AddProperty(DBPROP_AUTH_USERID,m_username); m_dbproset.AddProperty(DBPROP_AUTH_PASSWORD,m_password); m_dbproset.AddProperty(DBPROP_INIT_CATALOG,L"DEFAULT_DATABASE"); CDataSource m_datasource; m_datasource.Open(L"SQLOLEDB",&m_dbproset,1); When I call CDataSource::Open menthod I was informed that some OLE DB process make mistake. Can anyone tell me is there anything wrong with my codes or I missed sth? Thank you very much.

    Lisoft

    R 1 Reply Last reply
    0
    • L lisoft

      dear all: I'm trying to use OLE DB to access the SQL Server instead of ODBC(MFC) which I was quite familar. Here is some simple codes I used to open data source: CString m_username,m_password; ... ... CDBProSet m_dbproset; m_dbproset.AddProperty(DBPROP_INIT_DATASOURCE,L"SQL_SERVER_HOSTNAME"); m_dbproset.AddProperty(DBPROP_AUTH_USERID,m_username); m_dbproset.AddProperty(DBPROP_AUTH_PASSWORD,m_password); m_dbproset.AddProperty(DBPROP_INIT_CATALOG,L"DEFAULT_DATABASE"); CDataSource m_datasource; m_datasource.Open(L"SQLOLEDB",&m_dbproset,1); When I call CDataSource::Open menthod I was informed that some OLE DB process make mistake. Can anyone tell me is there anything wrong with my codes or I missed sth? Thank you very much.

      Lisoft

      R Offline
      R Offline
      Rob Graham
      wrote on last edited by
      #2

      Maybe if you posted the actual error message someone could help... Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed. Carl Sandburg

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups