i want to conncet to a ms sql server,but the debug info: "invalid pointer!"
is there any problems in my coding?
by debugging, i know the problem must lie in the variant strConnect.
i use ms sql server 2000+ winxp+ visual c++6.0
_ConnectionPtr m_pConnection ;
void ADOConn::OnInitADOConn()
{
::CoInitialize(NULL);
try
{
m_pConnection.CreateInstance("ADODB.Recordset");
_bstr_t strConnect="Provider=SQLOLEDB;
TRUSTED_CONNECTION=TRUE;//use windows log in
Initial Catalog=...../*database name*/;
Data Source=SJTU-3V87CA6SZP";//server name
m_pConnection->Open(strConnect,"","",adModeUnknown);
}
catch (_com_error e) {
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
TRACE( "Exception thrown for classes generated by #import" );
TRACE( "\tCode = %08lx\n", e.Error());
TRACE( "\tCode meaning = %s\n", e.ErrorMessage());
TRACE( "\tSource = %s\n", (LPCTSTR) bstrSource);
TRACE( "\tDescription = %s\n", (LPCTSTR) bstrDescription);
}
}OK, I think you forgot to add the Microsoft.ADODB to the project references list. Try that and let me know.
Sree|||do you mean i must add #import "c:\program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF") rename("BOF","adoBOF")??
i have added it to the .h file
if you refer to a different meaning, please tell me the meaning of "project reference list"
thank you very much!!
Showing posts with label invalid. Show all posts
Showing posts with label invalid. Show all posts
Wednesday, March 21, 2012
Monday, March 12, 2012
I tried to sign on to my web site using the ASPnet_membership table and got a error with m
This is the error that I got. Is it a Resevered Table name or something
Invalid column name 'LastLoginDate'.
Invalid column name 'LastLoginDate'.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details:System.Data.SqlClient.SqlException: Invalid column name 'LastLoginDate'.
Invalid column name 'LastLoginDate'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.What do you mean by "I tried to sign on to my web site using the ASPnet_membership table and got a error with my table."? HOW were you trying to sign in? Using a control? By entering a record into the table?
LastLoginDate IS one of the fields in the aspnet_Membership table.
Can you post the stack trace?
Labels:
aspnet_membership,
column,
database,
error,
invalid,
lastlogindate,
microsoft,
mysql,
oracle,
resevered,
server,
somethinginvalid,
sql,
table,
web
Subscribe to:
Posts (Atom)