Click here to Skip to main content
16,013,642 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Printing from a webpage Pin
Gavin_Mannion7-Jun-02 3:52
Gavin_Mannion7-Jun-02 3:52 
GeneralConnection Pooling Pin
Mr. Bill6-Jun-02 13:30
Mr. Bill6-Jun-02 13:30 
QuestionBest ASP.NET sites? Pin
Todd Smith6-Jun-02 10:56
Todd Smith6-Jun-02 10:56 
AnswerRe: Best ASP.NET sites? Pin
Rama Krishna Vavilala8-Jun-02 17:04
Rama Krishna Vavilala8-Jun-02 17:04 
QuestionThirty For Free Web Hosting ??? Pin
Romeo6-Jun-02 6:20
Romeo6-Jun-02 6:20 
AnswerRe: Thirty For Free Web Hosting ??? Pin
KoalaCowboy6-Jun-02 7:02
KoalaCowboy6-Jun-02 7:02 
AnswerRe: Thirty For Free Web Hosting ??? Pin
Not Active7-Jun-02 9:38
mentorNot Active7-Jun-02 9:38 
GeneralSQL Server API problem... Pin
6-Jun-02 4:24
suss6-Jun-02 4:24 
Hello;

I have trouble with SQL Server 7.0 API. I'm getting following error at link phase. Source code at below; (VC++ 6)

// SmcDatabase.cpp: implementation of the CSmcDatabase class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "smc_client.h"
#include "SmcDatabase.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

#define MAXBUFLEN 255

#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <odbcss.h>
#include <afxpriv.h>
#include <afxdisp.h>



//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSmcDatabase::CSmcDatabase()
{

}

CSmcDatabase::~CSmcDatabase()
{

}

HRESULT CSmcDatabase::Connect(char* server, char* uid, char* pwd)
{
SQLHENV henv = SQL_NULL_HENV;
SQLHDBC hdbc1 = SQL_NULL_HDBC;
RETCODE retcode = 0;

// This format of the SAVEFILE keyword saves a successful
// connection as the file Myfiledsn.dsn in the ODBC default
// directory for file DSNs.
SQLCHAR szConnStrIn[MAXBUFLEN] =
"SAVEFILE=MyFileDSN;DRIVER={SQL Server};SERVER=MySQL;"
"NETWORK=dbmssocn;UID=sa;PWD=MyPassWord;";

SQLCHAR szConnStrOut[MAXBUFLEN];
SQLSMALLINT cbConnStrOut = 0;

// Allocate the ODBC Environment and save handle.
retcode = SQLAllocHandle (SQL_HANDLE_ENV, NULL, &henv);

// Let ODBC know this is an ODBC 3.0 application.
retcode = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION,
(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER);

// Allocate an ODBC connection handle and connect.
retcode = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc1);
retcode = SQLDriverConnect(hdbc1, // Connection handle
NULL, // Window handle
szConnStrIn, // Input connect string
SQL_NTS, // Null-terminated string
szConnStrOut, // Addr of output buffer
MAXBUFLEN, // Size of output buffer
&cbConnStrOut, // Address of output length
SQL_DRIVER_NOPROMPT);

return(retcode);
}

Error message;
--------------------Configuration: smc_client - Win32 Debug--------------------
Linking...
SmcDatabase.obj : error LNK2001: unresolved external symbol _SQLDriverConnect@32
SmcDatabase.obj : error LNK2001: unresolved external symbol _SQLSetEnvAttr@16
SmcDatabase.obj : error LNK2001: unresolved external symbol _SQLAllocHandle@12
Debug/smc_client.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

smc_client.exe - 4 error(s), 0 warning(s)

Thank you for helps...
GeneralRe: SQL Server API problem... Pin
Remco V6-Jun-02 5:53
Remco V6-Jun-02 5:53 
GeneralRe: SQL Server API problem... Pin
Orkun GEDiK6-Jun-02 8:55
Orkun GEDiK6-Jun-02 8:55 
GeneralHiding user controls vs dynamic creation Pin
Senkwe Chanda6-Jun-02 4:04
Senkwe Chanda6-Jun-02 4:04 
GeneralStupid WebForm Designer Behavior Pin
Jamie Nordmeyer5-Jun-02 12:16
Jamie Nordmeyer5-Jun-02 12:16 
GeneralRe: Stupid WebForm Designer Behavior Pin
Senkwe Chanda6-Jun-02 4:10
Senkwe Chanda6-Jun-02 4:10 
GeneralRe: Stupid WebForm Designer Behavior Pin
Jamie Nordmeyer6-Jun-02 5:47
Jamie Nordmeyer6-Jun-02 5:47 
QuestionConvert seconds to hours in aspx bind? Pin
Todd Smith5-Jun-02 7:43
Todd Smith5-Jun-02 7:43 
AnswerRe: Convert seconds to hours in aspx bind? Pin
Not Active7-Jun-02 9:53
mentorNot Active7-Jun-02 9:53 
GeneralRe: Convert seconds to hours in aspx bind? Pin
Todd Smith7-Jun-02 12:30
Todd Smith7-Jun-02 12:30 
GeneralStupid IIS problem Pin
James Spibey4-Jun-02 6:43
James Spibey4-Jun-02 6:43 
GeneralRe: Stupid IIS problem Pin
James Spibey4-Jun-02 23:58
James Spibey4-Jun-02 23:58 
GeneralRe: Stupid IIS problem Pin
Remco V6-Jun-02 6:03
Remco V6-Jun-02 6:03 
GeneralRe: Stupid IIS problem Pin
James Spibey6-Jun-02 9:41
James Spibey6-Jun-02 9:41 
GeneralRe: Stupid IIS problem Pin
Richard Deeming7-Jun-02 0:14
mveRichard Deeming7-Jun-02 0:14 
GeneralHTML Table tabing Pin
Fayez Al-Naddaf4-Jun-02 4:48
Fayez Al-Naddaf4-Jun-02 4:48 
GeneralRe: HTML Table tabing Pin
MS le Roux6-Jun-02 9:26
MS le Roux6-Jun-02 9:26 
GeneralImport Excel-files with ASP Pin
Morten, Norway4-Jun-02 4:03
Morten, Norway4-Jun-02 4:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.