Hello, I am working on a dll that is being loaded by browsers. I have to check if the hostname of a requested page is in a database containing sites that have to be blocked. I am using the following code to connect to the db:
The strange thing is that this code is running fine with Internet Explorer but when the dll is loaded by Firefox pConn->Open() fails with Invalid pointer error. Any suggestions will be greatly appreciated. Thank you.Martin
I searched the archives but couldn't find anything on this yet...
I am using the wizard to grab selected data from 6.5 Server1 to insert into a table on 6.5 Server2, no transformations necessary.
I've tried it two ways (actually more, but two ways will demonstrate the problem). The query I run to grab the data is search through approx 6.5 million records in poorly indexed tables, on a slow machine. Takes approximately 45 minutes to run the query alone, and right around the same to run the DTS package.
The difference between the two queries in the two different packages (all else equal), is that the first uses a variable to calculate a date to filter the where clause. The second hard codes the date in the where clause. The second works, but the first runs about 40 minutes before returning a Transfer Failed error that reads "Invalid Pointer". No error number, nothing in the Books online about the error.
The queries are as follows: *************************************** QUERY 1 (calculates the date for 11:00 PM night before last)
select s.SerialNumber as iwSerialNumber, MAX(p.ReceiptTime) AS iwLastReceived, p.PurchaseOrderNumber as iwPO, s.Revision as iwBomRev, s.PartNumber as iwPartNumber From SLOCAZ s INNER JOIN PORDRZ p ON s.SerialNumber = p.SerialNumber Where p.ReceiptTime > @DateLastReceived And ( (p.PurchaseOrderNumber Like 'BD%') OR (p.PurchaseOrderNumber Like 'TP%') OR (p.PurchaseOrderNumber Like 'DM%') ) GROUP BY s.SerialNumber, p.PurchaseOrderNumber, s.Revision, s.PartNumber
*************************************** QUERY 2 (Hard codes the date)
select s.SerialNumber as iwSerialNumber, MAX(p.ReceiptTime) AS iwLastReceived, p.PurchaseOrderNumber as iwPO, s.Revision as iwBomRev, s.PartNumber as iwPartNumber From SLOCAZ s INNER JOIN PORDRZ p ON s.SerialNumber = p.SerialNumber Where p.ReceiptTime > 'Aug 29 1999 11:00PM' And ( (p.PurchaseOrderNumber Like 'BD%') OR (p.PurchaseOrderNumber Like 'TP%') OR (p.PurchaseOrderNumber Like 'DM%') ) GROUP BY s.SerialNumber, p.PurchaseOrderNumber, s.Revision, s.PartNumber
***************************** I should also note that I thought maybe the hard coded date being used as a string was the difference, so I tried the following (which just converts the date back into a char variable and uses the char variable in the where clause)
select s.SerialNumber as iwSerialNumber, MAX(p.ReceiptTime) AS iwLastReceived, p.PurchaseOrderNumber as iwPO, s.Revision as iwBomRev, s.PartNumber as iwPartNumber From SLOCAZ s INNER JOIN PORDRZ p ON s.SerialNumber = p.SerialNumber Where p.ReceiptTime > @CharLastReceived And ( (p.PurchaseOrderNumber Like 'BD%') OR (p.PurchaseOrderNumber Like 'TP%') OR (p.PurchaseOrderNumber Like 'DM%') ) GROUP BY s.SerialNumber, p.PurchaseOrderNumber, s.Revision, s.PartNumber
************************************ This still didn't work...
Any Ideas on what is happening and/or how to fix it??? Amy
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
_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);
I am by no means a "Database Expert" and have recently been asked toassist with a SQL 2000 database move to a new server. I was wonderingif there was an easy way to reconfigure the ODBC pointers on theworkstations?Thanks for the help in advance.
HI, We upgraded to SQL Server 2005 Standard Edition for our ASP.NET 2.0 website. We were using SQL Server Express 2005. That worked fine. Now we are unable to connect to the database. I have googled, but I just cann't figure out what is going on. Any help is appreciated. Here is the error. An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) In our firewall sqlbrowser.exe and sqlservr.exe are allowed. Thanks Matt
Ok I'm trying to connect to my easycgi.com MSSQL database.I can connect OK.My ID is in the db_owner group.I can create and edit tables and data.I can open a table and see the data.I can view the SQL statement behind the open table (select * from Table) and execute it successfully.But if I open a new query window and type "select * from [table]" (or any other query), no matter which table it is, I get an error:Msg 208, Level 16, State 1, Line 1Invalid object name '[table name]'.I've searched the web and found this error plenty of times, usually associated with security or the schema. But all my objects are under dbo and I'm in db_owner... ???
When trying to connect to a remote SQL 2005 Express Server, I get this error message: [DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection. I can remotely connect to the server with the same username and password using osql in command and I can also connect to the server remotely with SQL Server Management Studio installed on this machine. Here is my connection string: Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=uid;Initial Catalog=EBM;Data Source=xxx.xxx.xxx.xxxSQLEXPRESS;Use Encryption for Data=False The same connection string works if connecting locally, via changing the ip address to the machine name: Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=uid;Initial Catalog=EBM;Data Source=machinenameSQLEXPRESS;Use Encryption for Data=False
I get a Invalid Column Name ' '. with this procedure. Can anyone see what migh be wrong?
Thanks,
SELECT A.CompanyName,C.FirstName,C.LastName,C.Client_ID, CASE WHEN A.[CompanyName] IS NULL OR A.[CompanyName] = '' THEN C.[FirstName] +" "+ C.[LastName] ELSE A.[CompanyName] END AS DRName, C.Client_ID FROM tblClients C INNER JOIN tblClientAddresses A ON C.Client_ID = A.Client_ID WHERE (C.Client_ID = 15057) AND (A.MailTo=1) AND Convert(varchar(5), GETDATE(), 10) BETWEEN Convert(varchar(5), A.Startdate, 10) AND Convert(varchar(5), A.Enddate, 10) OR (A.Startdate Is Null) AND (A.EndDate Is Null) GO
Declare @strSql nvarchar(255) Set @strSql="Select * from table WHERE " Set @strSql=@strSql + 'Price BETWEEN ' + CONVERT(nvarchar(20),@MinPrice) + ' and ' + CONVERT(nvarchar(20),@MaxPrice )
If @TypeHome != "No Preference" Set @strSql=@strSql + ' and Type = ''' + @TypeHome+ ''''
If @Location != "No Preference" Set @strSql=@strSql + ' and City = ''' + @Location+ ''''
Set @strSql=@strSql + ' and IDX = ''Y'' ORDER BY Price' Exec(@strSql) GO
The Error I get is: "Error 207: Invalide Column Name 'Select * from table WHERE' Invalid Column Name 'No Preference' Invalid Column Name 'No Preference'
I have checked the table and the columns do exist, spelled correctly and caps are all the same. Also, this same SP in another table works just fine.
Hey everyone, hope you all can help me with this problem. We have a remotely hosted website, but we have a SQL server in our company (powers our instore portal). I have set up our router so that i can connect to remote desktop and sql server. I can connect to the remote desktop and i can connect to the sql server with query analyzer. On our local site i can set up a connection to look at sqlserver.underpargolfutah.org and it works fine, everything goes well. Now here is the problem. On the hosted site i have set up the following web.config > <appSettings> <add key="sql_dsn" value="server=************.underpargolfutah.org;database=online;uid=sa;pwd=*******" /> </appSettings> default.aspx > Public Class shopDB 'publicly declare typical stuff for connections Public conn As SqlConnection Public cmd As SqlCommand Public reader As SqlDataReader Public dsn As String = ConfigurationSettings.AppSettings("sql_dsn").ToString Public Function getBaseSelectionsByType(ByVal type) 'declare the connection conn = New SqlConnection(dsn) 'declare command cmd = New SqlCommand("SELECT * FROM category", conn) 'open the connection conn.Open() 'grab data reader = cmd.ExecuteReader(CommandBehavior.CloseConnection) Return reader End Function End Class This should all work but i get the following error [SqlException: Invalid connection.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 v3.shopDB.shopDB.getBaseSelectionsByType(Object type) in shopDB.vb:21 v3.shop_default.Page_Load(Object sender, EventArgs e) in default.aspx.vb:32 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +742Any ideas? i am stumped. Thanks in advance-Darren
Can anyone tell me why I get the above message using the following stored procedure and passing in a value of 120: CREATE Procedure qryAnalysisCountMain (@WizardGroup1Question int) As EXEC("SELECT QuestionDescription FROM Questions WHERE QuestionCode = " + @WizardGroup1Question)
120 just happens to be the asci value of 'x' and whatever number I pass in gets converted into it's character equivalent and the sp tells me it can't find that column name. QuestionCode is an int field so there is no problem there
The procedure works OK with: SELECT QuestionDescription FROM Questions WHERE QuestionCode = @WizardGroup1Question
However I need the SQL in an EXEC as the sp will eventually be dynamic so that i can pass in the name of the table to select from.
Hi I have a dynamic select statement which is showed below. declare @query varchar(100) set @query = 'select * from undergraduate where Gender =' + @Gender exec (@query)
// When I execute the @query, I get an error message like "Invalid Column Name Male". I think I need to put a single quotation around the dynamic variable, so that I have select * from undergraduate where Gender ='Male'. But I am not sure how to do that.
When running 'select * from <table> everyone gets 'invalid object' error. When they run 'select * from <database>.<objectowner>.<table> it works fine. This would lead one to believe that they're either not in their default database or that they don't own the objects. However this is not the case.
Why do they need to qualify everything if they're running from their own databaase, they own the object and they're logged in as the objectowner?
This was working fine one day but not the next. They connect using a DSN that's on a web server and they pass their login and password but not their database. I don't have this problem and can't duplicate anyone else's, but I'm not on the web server, I'm going directly to teh SQL server using Query Analyzer.
I'm connecting to an SQL Server database through a Perl script (using Win32::ODBC). The connection seems to go through fine, as in, I get no errors. But even simple statements like "Select * from AccountTable" dont work. I get the error Invalid Object Name 'AccountTable'. The table exists and I even gave myself explicit permission for "SELECT" statements for that table.
Are there any other permissions that need to be set? The DSN defaults to the database that I need.
Any help would be most appreciated. I'm going mad here. Thanks. -Amrita
as i run my code (windows application) i get this error
Invalid object name 'dbo_TASk'. Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.
/****** Object: Stored Procedure dbo.stp_per_task_by_system_sel Script Date: DATE ******/ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[stp_per_task_by_system_sel]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) DROP PROCEDURE [dbo].[stp_per_task_by_system_sel] GO
CREATE PROCEDURE dbo.stp_per_task_by_system_sel ( @sys_id int ) AS -------------------------------------------------------------------------------- -- Created by : Jacco B -- Date created : 1-febrauri-2007 -------------------------------------------------------------------------------- -- Description : deze stp haalt de specefieke taken van een geselecteerd systeem uit de database -------------------------------------------------------------------------------- -- Test string : stp_per_task_by_system_sel 'var' -------------------------------------------------------------------------------- -- Change Log : Date By Description -- -------- ------ ------------------------------------ -- -------------------------------------------------------------------------------- BEGIN SET NOCOUNT ON --declaratie locale variabelen DECLARE @error integer, @object_name varchar(30)
--begin transactie SELECT @object_name = object_name(@@procid) BEGIN TRAN @object_name
--begin procedure SELECT SYSTEM_STANDARD_TASK.*, TASk.* FROM SYSTEM_STANDARD_TASK INNER JOIN dbo_TASk ON SYSTEM_STANDARD_TASK.tas_id = TASk.tas_id WHERE SYSTEM_STANDARD_TASK.sys_id = @sys_id
--Errorafhandeling SELECT @error = @@error IF @error <> 0 BEGIN ROLLBACK TRAN @object_name RETURN @error END
--commit transactie COMMIT TRAN @object_name RETURN 0 END
GO
--grant exec to sql group GRANT EXECUTE ON [dbo].[stp_per_task_by_system_sel] TO [PERIODIEK_USER] GO
Hi, My application uses VB6 and Sql-Server 2000. I can’t understand why the error INVALID OBJECT NAME Run-time error '-2147217865 (80040e37)' appears only sometimes and not always. For example, a select instruction is executed inside a loop without any problem 1 thousand times, then when I try to execute it 1 thousand times and one, it fails.
Have you got any suggestions?
I’ve read a lot of posts on Internet Forums, without finding any solutions.
In the mail I attach, you can see that the application stops at 79%, after having executed many times the select instruction without any problem!
I am getting the "Invalid use of Null" message when I execute the following code under the following conditions.
fields in SQL Server table db_date varchar(30) --> "December 29" db_subject varchar(200) --> "Test Subject" db_thought text --> "This is a test to see if this works"
I execute the following code from VB6
strText = "select * from db_table where db_date = 'December 29'" ors.open strText, dbConnect if not ors.eof then if not isnull(ors("db_thought")) then txtBox1 = ors("db_thought") end if end if
Here is my problem. Since there is a value in db_thought the code if not isnull(ors("db_thought")) evaluates to true -- this is what I expect. However when I try to assign the ors("db_thought") to the txBox1 field I get an Invalid use of Null. What am I missing?
First I restored the master database and after the others databases. But when I connect by Query Analyser with a user that is a DBO and I execute a select the system return : "Invalid object name 'XXXX'"
This is what I have. It works fine until I get to the select statement, then it tells me that I have an invalid object name. What am I missing? Thanks!
DECLARE @SvrName varchar(100)
if @@SERVERNAME='pubs' begin set @SvrName=’pubs.books.isbn’ print @SvrName end if @@SERVERNAME='MGMFILENET' begin set @SvrName=’store.books.isbn’ print@SvrName end
print @@SERVERNAME PRINT @SvrName SELECT * FROM "@SvrName"
I am building a shopping cart program, complete with an admin back end. I am using ASP.NET, VB. NET and a SQL SERVER 2000 database.
The cart is working well... items can be added, updated and removed. However when trying to access the orders stored in the database from the admin section of the application, I am getting an "invalid record count" error.
I have no idea what this means. I've tried looking it up online, but so far no luck.
The orders are being stored in two tables connected via a foreign key. I have no problem writing to the tables, it's just a problem reading the tables. I have dropped the two tables twice and rebuilt them, but I get the same error each time.
SELECT PRODUCT_ID, PRODUCT_END_DATE, CASE WHEN PRODUCT_ID = 1 THEN DATEADD(YY,-5,PRODUCT_END_DATE) WHEN PRODUCT_ID = 2 THEN DATEADD(YY,-10,PRODUCT_END_DATE) WHEN PRODUCT_ID = 3 THEN DATEADD(YY,-15,PRODUCT_END_DATE) END AS MODIFIED_END_DATE FROM PRODUCTS WHERE MODIFIED_END_DATE BETWEEN '2008-04-01' AND '2008-04-30'
when I execute this query returns an error as Invalid column name MODIFIED_END_DATE
I have my column names right but its telling me they are invalid. It must be something to do with how I have my subquery formatted but I don't see it. I was wondering if anyone else can see it? It tells me payer_id is not right and I know its coming from the bolded section. I just added that line to do some additional grouping. I know that the query above aliased as D was working before I put the bolded line in. Am I setting this up wrong?
select distinct c.description,tmp.person_id,tmp.person_nbr,tmp.first_name, tmp.last_name,tmp.date_of_birth,d.payer_name,b.create_timestamp from PersonMIA tmp join person a on a.person_id = tmp.person_id join patient_encounter b on a.person_id = b.person_id join provider_mstr c on b.rendering_provider_id = c.provider_id cross apply(select top 1 payer_name from person_payer where person_id = tmp.person_id order by payer_id) d join payer_mstr e on d.payer_id = e.payer_id join mstr_lists f on e.financial_class = f.mstr_list_item_id where c.description = 'Leon MD, Enrique' group by c.description,tmp.person_id,tmp.person_nbr,tmp.first_name,tmp.last_name, tmp.date_of_birth,d.payer_name,b.create_timestamp )tmp2 where year(create_timestamp) IN (2005,2006) group by person_nbr,payer_name,first_name,last_name,description,create_timestamp
Please help how to solve the invalid use of Null value in numeric field
1. Query name : Genled ---------------------- SELECT PARTY.PARTYNAME AS PARTYNAME, GEN.GLNAME AS GLNAME, GEN.AMOUNT AS OAMOUNT, CASH.CASHNAME AS CASHNAME, TXN.CBCODE AS CBCODE, GEN.CB AS CB, TXN.GLCODE AS GLCODE, TXN.VOUCHER AS VOUCHER, TXN.DOCDATE AS DOCDATE, TXN.AMOUNT AS TAMOUNT, TXN.VTYPE AS VTYPE, TXN.NARR AS NARR, TXN.CHEQUE AS CHEQUE, TXN.CHEQDATE AS CHEQDATE, TXN.BANK AS BANK, TXN.BILLNO AS BILLNO, TXN.BILLDT AS BILLDT FROM PARTY RIGHT JOIN (GEN LEFT JOIN (TXN LEFT JOIN CASH ON TXN.CBCODE = CASH.CBCODE) ON GEN.GLCODE = TXN.GLCODE) ON PARTY.PARTYCODE = TXN.PARTYCODE WHERE (((GEN.GLCODE) Not In (SELECT CASHCODE FROM CASH)));
2. From query 1 i have to create temporary table ogenled & generalled
3. From table ogenled i have pass this query - select glname, oamount, sum(tamount) as tamt, (oamount+sum(tamount))as opbal from ogenled group by glname, oamount order by glname
4. from query 3 i have update generalled table for opbal but the problem is this if only oamount is <>0 and tamt is empty then error message show "INVALID USE OF NULL"
5. gen table contain the glname, oamount , txn table contains the detail transaction. It is quite possible that only opening amt is exit. by query it nothing transaction is done than tamount field show " "
6. Please help how to show the default value 0 insted of " "
I am building a query and thought I had completed it but I get 'Invalid Column Name "A1" when I run it? SELECT Groups.GroupID, Sum(Stages_On_Route.Distance) AS Miles_Covered, Groups.Group_Name FROM Groups INNER JOIN ((Route INNER JOIN Departure ON (Route.GroupID=Departure.GroupID) AND (Route.RouteID=Departure.RouteID)) INNER JOIN Stages_On_Route ON Route.RouteID=Stages_On_Route.RouteID) ON Groups.GroupID=Departure.GroupID GROUP BY Groups.GroupID, Groups.Group_Name HAVING (((Groups.GroupID)="A1"));
Im 3 months into building a web page for my company. I want to insert and update data into the data base, but i keep getting this error message (Incorrect syntax near 'nvarchar') I have no programing experience and I dont understand the stack trace. Im using visual web developer which comes with sql express. Here is all the code. Thank you all for any help offered. jdslim
Incorrect syntax near 'nvarchar'. 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: Incorrect syntax near 'nvarchar'. Stack trace