Open Database Connectivity [ODBC]
Girish Software Developer
Open Database Connectivity [ODBC]
Girish Software Developer
Communication between CSocket and BSD Socket Hi Friends, I wanted some help on my project as i have stuck at a place. Basically i am developing a Client Server Application. My Server is using a class derived from CSocket. Wherein i wanted is it possible to communicate a Client which is based on BSD Socket with a Server which is build using CSocket. With Rgds
Girish Software Developer
Hello Friends, I am been using CSocket in my application. But i want to know is CSocket a blocing socket or non-blocking socket, and what are the differences between them ?
Girish Software Developer
Hello guys, I am been working on developing a plugin for Adobe Director, Speech recognition. I am been getting Stuck in a macro USES_CONVERSION. It is unable to execute the statements following this macro. Can anybody provide help exactly how to debug this particular error
Girish Software Developer
Hello Neil, Thanx for your timely suggestion Can i know exactly further how should i go ahead. I want to send a file through UDP. I am aware of it using in TCP. Can i know how it is done in UDP Thanx in Advance
Girish Software Developer
Thanks folks for your valuable advice of Tcp over Udp. As far as my requirements are concerned, it demands UDP. Bcoz the scenario is such that we have to broadcast packets at the same to n number of Machines across the network.That's the reason i need help on Sending files over UDP protocol. I have worked previously on TCP,but not on UDP. As far as previous post is concerned,somebody said that it is similar as creating Socket and Sending it using IP and Port. I hope in UDP you are sending on a Broadcast IP and port,so how to do it. Thankx in Advance.
Girish Software Developer
Hello Friends Can any body on the forum Could help me out in knowning how can one Send a file through UDP. Is there any specific function for the doing the same, or any separate mechanism is required. My following requirement is for VC++ 7.1/6.0
Girish Software Developer
Hello people Can anybody explain why my CSocket Receive call fails when i use it with threading With Rgds
Girish Software Developer
Hello vivek , u need to check connectionstrings.com to connect excel file to ur application. kamlesh
Girish Software Developer
Hi Guys, I am been a member of the team developing a WebServer. I wanna want to know that is it possible to make a TCP connection to the webserver wherein my client is behind the proxy. Does this condition looks Feasible ? Kindly looking for an reply. girish
Girish Software Developer
Hi Friends, I wanna some help on WinInet Programming. I am writing a VC++ client which is supposed to communicate a web Server written in C#.net. I am able to send a request to Web Server but how to read the contents send by WebServer can anybody help me in this ? Following is my code: HINTERNET hOpen,hConnect,hRequest; BOOL retval; DWORD dwErrorCode;//=12032; CString data="cmdCreateSessionID"; hOpen=InternetOpen("HttpApp/1.0", INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0); hConnect=InternetConnect(hOpen, SERVER_LAN_NAME,4000, NULL,NULL, INTERNET_SERVICE_HTTP,0,0); CString method="POST"; CString url="index.html"; DWORD dwFlags=0; hRequest=HttpOpenRequest(hConnect,method,url, NULL, NULL, NULL, dwFlags, 0); DWORD R1=GetLastError(); HttpSendRequest(hRequest,NULL,0,data.GetBuffer(), data.GetLength()); dwErrorCode = hRequest ? ERROR_SUCCESS : GetLastError(); CString lpBuffer; INTERNET_BUFFERS dwStruct; DWORD dwNumberOfBytesToRead,dwNumberOfBytesRead; dwNumberOfBytesRead=dwNumberOfBytesToRead=0; BOOL retReadFile=InternetReadFile(hRequest,&lpBuffer,dwNumberOfBytesToRead, &dwNumberOfBytesRead); In the InternetReadFile function i am unable to read any buffer. With Rgds VC++ Girish Software Developer
Hello, By using WinInet Api,I can know that I am connected via LAN but is there any Api by using which I can know that i am connected via WLAN or not. Regards Girish Software Developer
Hi friends, we try to use port forwarding concept in our application. freinds is their any software for port forwarding is available , so that we will use it in our application. or any sample code for port forwarding is available , so we will study that code and try to use in our application. If any links regarding port forwarding is ezists , provide us. frinds kindly give us reply. regards Girish Software Developer
Hi friends, we are trying to establish connection between vnc client and server vai stunnel and openssl.we perform all steps. reference for steps is given at following address D:\Openssl\OpenSSl\Remote Desktop Management Solution for Microsoft.htm according to steps,create certificates for vncclient and vncserevr for authentication. final o/p is not establish connection. o/p comes is as follows in log file which is not correct 2006.05.13 15:38:09 LOG5[1804:1712]: stunnel 4.15 on x86-pc-mingw32-gnu with OpenSSL 0.9.7i 14 Oct 2005 2006.05.13 15:38:09 LOG5[1804:1712]: Threading:WIN32 SSL:ENGINE Sockets:SELECT,IPv6 2006.05.13 15:38:09 LOG5[1804:1976]: No limit detected for the number of clients friend kindly give us reply about our problem. regards Girish Software Developer
Hi, We are trying to establish connection between Delegate client and server. we able to set Delegate server. we are having problem to set Delegate client. If we try to establish connection, following error occur 1) unknown parameter: -P8021 FCL 2) NIS not available 3) ## cannot load z pls provide soln for above problem. so we are able to establish connection. regards Girish Software Developer
Hi friends, We are trying to Install Delegate, to be working alongwith the Vnc. At the time of installing, we are encountering error. Error is "cannot load Z". We are executing 5LoavesSvc.exe on the remote machine which is running vnc server,but it vanishes from the Task manager, Can Anybody help us out in sorting the problem. With Rgds Girish Software Developer
Hello Friends Help is required from anybody who has done coding for http connectivity using VC++ 6.0 using MFC. Following is the scenario wherein i am trying to connect the site by authenticating the proxy server. Following are the steps which i am following, if i am work pls guide me out. CInternetSession *pSession; CHttpConnection *pConnection; CHttpFile *pFile; CString strObject; CString szAuthLine; BOOL bResult; DWORD dwRet; pSession= new CInternetSession (NULL,1,INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0); pConnection=pSession->GetHttpConnection (_T("http://www.codeproject.com"),1,808,"girish","girish2005"); pFile=pConnection->OpenRequest(NULL,strObject, NULL,1,NULL,NULL,NULL); szAuthLine="girish:girish2005"; pFile->AddRequestHeaders(szAuthLine, HTTP_ADDREQ_FLAG_ADD,strlen(szAuthLine)); bResult=pFile->SendRequest(szAuthLine,NULL,0); Following mentioned above is the code pls help me out. With Rgds Girish Software Developer
Hi, some sample code for read data from xls file. CDatabase database; CString sSql; CString Name, Address; CString sDriver; CString sDsn; CString sFile = "c:\\kdr.xls"; // the file name. Could also be something like C:\\Sheets\\WhatDoIKnow.xls // Clear the contents of the listbox m_List.ResetContent(); // Retrieve the name of the Excel driver. This is // necessary because Microsoft tends to use language // specific names like "Microsoft Excel Driver (*.xls)" versus // "Microsoft Excel Treiber (*.xls)" sDriver = GetExcelDriver(); if( sDriver.IsEmpty() ) { // Blast! We didn´t find that driver! AfxMessageBox("No Excel ODBC driver found"); return; } // Create a pseudo DSN including the name of the Driver and the Excel file // so we don´t have to have an explicit DSN installed in our ODBC admin sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile); TRY { // Open the database using the former created pseudo DSN // sSql = "INSERT INTO demo (Name,Address) VALUES ('Nilesh','Pune')"; // database.ExecuteSQL(sSql); database.Open(NULL,false,false,sDsn); // Allocate the recordset CRecordset recset( &database ); // Build the SQL string // Remember to name a section of data in the Excel sheet using "Insert->Names" to be // able to work with the data like you would with a table in a "real" database. There // may be more than one table contained in a worksheet. sSql = "SELECT Name, Address " "FROM demo " "ORDER BY field_1"; // Execute that query (implicitly by opening the recordset) recset.Open(CRecordset::forwardOnly,sSql);//,CRecordset::readOnly); // m_List.AddString( Name + " --> "+Address ); // recset.Open(NULL,sSql,NULL); // Browse the result // while( !recset.IsEOF() ) // { // Read the result line recset.GetFieldValue("field_1",Name); recset.GetFieldValue("field_2",Address); // Insert result into the list // m_List.AddString( Name + " --> "+Address ); // Skip to the next resultline recset.MoveNext(); // } // Close the database database.Close(); } CATCH(CDBException, e) { // A database exception occured. Pop out the details... AfxMessageBox("Database error: "+e->m_strError); } END_CATCH; } problem occur after recset.Open(CRecordset::forwardOnly,sSql);//,CRecordset::readOnly); it is not enter into condition. go to catch and throw error Database error : To few parameters e
Hi friends, I use above class and CDaoRecordset for writing into xls file. I set one button. on button event, i write following code CString Sql,Name,Addr; GetDlgItemText(IDC_NAME,Name); GetDlgItemText(IDC_ADDRESS,Addr); db.Open("Pis.xls"); Sql = "SELECT * FROM Pis"; recset.Open(CRecordset::forwardOnly,Sql,NULL); recset.AddNew(); recset.SetFieldValue("Name",(LPCSTR)Name); recset.SetFieldValue("Addr",(LPCSTR)Addr); recset.Update(); recset.Close(); db.Close(); } when I enter name and address and click on button, error message come could'nt open database. unrecognise database format friend kindly give me a reply. why i am not able to write and read data from xls Regards kedar Girish Software Developer
Hi guys, I am trying to write into xls file. This part is ok. problem occur while reading from xls file. error shows as follows : syntax error in query expression field_2 by demo code I use for writing into xls file is as follows. void CWrite_read_xlsDlg::OnButton1() { CDatabase database; CString sDriver = "MICROSOFT EXCEL DRIVER (*.XLS)"; CString sExcelFile = "c:\\kdr.xls"; CString sSql; TRY { sSql.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s", sDriver, sExcelFile, sExcelFile); // create database i.e excel sheet if( database.OpenEx(sSql,CDatabase::noOdbcDialog) ) { // create table structure sSql = "CREATE TABLE demo (Name TEXT,Address TEXT)"; database.ExecuteSQL(sSql); // insert data into table i.e excel sheet sSql = "INSERT INTO demo (Name,Address) VALUES ('Nilesh','Pune')"; database.ExecuteSQL(sSql); sSql = "INSERT INTO demo (Name,Address) VALUES ('akash','Mumbai')"; database.ExecuteSQL(sSql); sSql = "INSERT INTO demo (Name,Address) VALUES ('ajit','thane')"; database.ExecuteSQL(sSql); sSql = "INSERT INTO demo (Name,Address) VALUES ('aaniket','Nashik')"; database.ExecuteSQL(sSql); } // close database database.Close(); } CATCH_ALL(e) { TRACE1("Driver not installed: %s",sDriver); } END_CATCH_ALL; } code I use for reading data from xls file void CWrite_read_xlsDlg::OnButton2() { CDatabase database; CString sSql; CString Name, Address; CString sDriver; CString sDsn; // register datasource in ODBC database manager CString sExcelFile = "c:\\kdr.xls"; m_cList.ResetContent(); sDriver = GetExcelDriver(); if(sDriver.IsEmpty()) { AfxMessageBox(" No Excel ODBC driver found "); } sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sExcelFile); TRY { database.Open(NULL,false,false,sDsn); //A CRecordset object represents a set of records selected from a data source. //Known as recordsets CRecordset recset(&database); sSql = "SELECT field_1,field_2" "FROM demo " "ORDER BY field_1"; // sSql = "SELECT * FROM demo"; // sSql = "INSERT INTO demo (Name,Address) VALUES ('Nilesh','Pune')"; //"ORDER BY Name"; recset.Open(CRecordset::forwardOnly,sSql,CRecordset