|
hi all,
I am using following autherization in the web config file using following tags
<authorization>
<allow roles="mydomain\mygroup"/>
<deny users="?" roles="BUILTIN\users"/>
</authorization>
<identity impersonate="true"/>
this works fine. But due to this , i am facing following problem...
when i try to connect to a remote SQL server, where login id and pwd of user is given in the connection string , then i am not allow to connect to the SQL server, with exception "either sql server doesn't exist or access is denied". But when i remove the deny tag from above tags then the authentication works fine. Can some body tell me what's the problem there and how can i overcome this problem. The connection string i am using is following
server=myserver;uid=testuser;pwd=12345;database=mytestdatabase;Integrated security=false
it is to mention that, this user "testuser" has administrators rights on the sql server .
|
|
|
|
|
I'm using ADO to write a ms access database program, it's very wierd to me that when i add a record into database and calling requery immediately, the count property of record set is wrong, but after a while, several seconds, when i requery again, the count is corrent. I think there is a delay in ado to reflect it.
How to resolve this issue. thanks.
I love C++
|
|
|
|
|
I'm writing a program to access the SQL SERVER using OLE DB Consumer templates. There was a strange problem found when I was trying to modify row data using CRowset::SetData method. Here is some key source code:
CDBPropSet ps(DBPROPSET_ROWSET);
ps.AddProperty(DBPROP_IRowsetChange,true);
ps.AddProperty(DBPROP_UPDATABILITY,DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE);
//...
Ctheclass record; //class Ctheclass :
public Command<CAccessor<CtheAccessor> >
record.Open(session,_T("TABLE_NAME"),&ps)
_tcscpy(record.column1,_T("Data to modify"));
record.SetData();
The problem is that sometime these code runs ok and the row data has been modified as expected but sometime the row data did not changed even the SetData() method returned S_OK.
Can any tell me if there is something wrong with my code or something I was missing.
Lisoft
|
|
|
|
|
I am modifiying code that sets up an excel connection string as follows:
Dim sExcelConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=NO;IMEX=1"""
The problem is that when I use a data adapter to fill the data set I get a "Not a legal OleAut date" error because sometimes I am trying to import and older version of an excel file. I don't get an error if the file is the latest version of excel. Basically, I need a way to determine the version of the excel file before I execute this statement. I would appreciate any suggestions.
Thank you
Glen
Glen
|
|
|
|
|
hi. i'm using vs 2005 beta and struggling to set up a project data source
when i try to use the data source configuration wizard, i only have the option to choose a "Web Service" or "Object". i need to be able to add a Local Database, but there is no icon available.
any ideas? do i have an installation issue?
thanks
|
|
|
|
|
Hi,
I have an archives sectionon my website. It must display all news except the news of the current. So if we work on the current year and month, then all news articles mut display except news articles that were added for February 2005. My logic says that they SQL statement must look somthing like:
SELECT NewsID_PK, NewsSubject, NewsDateAdded
FROM tblNews
WHERE (YEAR(NewsDateAdded) <> 2005 AND MONTH(NewsDateAdded) <> 2)
ORDER BY NewsDateAdded DESC;
But this doesn't display correctly. If I replace the AND with anOR thenit works,like this:
SELECT NewsID_PK, NewsSubject, NewsDateAdded
FROM tblNews
WHERE (YEAR(NewsDateAdded) <> 2005 OR MONTH(NewsDateAdded) <> 2)
ORDER BY NewsDateAdded DESC;
I don't understand why. Can some one please explain why. If there is a better way of writing this statement, please let me know.
Any help and suggestions would be appreciated!!
Thanks
Brendan
|
|
|
|
|
|
The first one seems to be correct. The second one isn't because will eliminate all dates containing 2005 as year and 02 as month
|
|
|
|
|
Hi,
I have the following 2 questions with which I need help with...
QUESTION 1:
I want to add a news article to a SQL Server 2000 database using classic ASP. I need to know what characters I should search for in the text which may/can display incorrectly.
For example this is what I do when there is an apostrophe in the text:
Replace(Request.Form("txtBody"), "'", "''")
For what other characters must I be aware of when adding to the database table?
QUESTION 2:
When displaying database text to a reader (through a web page) that has line breaks in it,is this the best way to do it? arr(2, 0) is a field in my table called NewsBody.
Replace(arr(2, 0), Chr(10), Chr(10) & " ")
With regards to question 1, what else needs to be taken care of when displaying data from a database table.
Any help and suggestions would be appreciated!!
Thanks
Brendan
|
|
|
|
|
|
I want to create a new table in SQL Server, which will populate Date, weeks, months and years. I want the dates starting from 1st January 2004 and finishing on 31st December, 2008. Basically i want to use this table as a mapping, so i know if dates are in between this range this is week 1, if dates are in between this range this is week 2, somthing like this.
I know this is possible in a sql query by writing case statement. But this is a lot of coding.
I was just wondering if someone could tell me how could i create a table like this by using DTS (ActiveX VBScript). Some kind of loop....
The problem is i do not know how to create a new table from ActiveX and insert data into it from ActiveX. Just letting you know that you can create/truncate table by using "Excute SQL Task". But it does not let you to create a workflow in between ActiveX and "Excute SQL Task". I think i got to create the connection in the ActiveX but not sure.
Can someone help, please? I am looking for a table like this :
Date_Time Week_No Month Year
3/1/2005, 09:01:44 PM 1 Jan 2005
4/1/2005, 09:01:44 PM 1 Jan 2005
.....
10/1/2005, 09:01:44 PM 2 Jan 2005
11/1/2005, 09:01:44 PM 2 Jan 2005
...
Thanks
Bob
|
|
|
|
|
HI
How i can create a rownumber column in my view results?
like this sample:
select f1 from table1
go
results:
f1
---
www
aaa
vvv
bbb
I WANT THIS FORM:
rowno f1
---- ---
1 www
2 aaa
3 vvv
4 bbb
thanks
|
|
|
|
|
Hi there. It depends on the database you are using - which one?
|
|
|
|
|
|
Okay. Unfortunately, there isn't a simple way (like Oracle's ROWNUM) to do this in SQL Server 2000. SQL Server 2005 will support a function for this, but in 2000 you have basically two directions you can go. One is to use a temporary table with an identity column - probably in a stored procedure so you can reuse it like you would a view. http://www.sqlteam.com/item.asp?ItemID=1491[^]
Another would be to use a specially constructed auto-join query designed to rank the results.
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q186133[^]
I suppose you could also create a stored procedure that loops through a cursor, but the performance would probably be bad.
|
|
|
|
|
You could create a temp table with an autonumber field for the "rowno" and do a INSERT SELECT from your current resultset.
Else, have a look at this [^]which might be of help.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards "Most of us are programmers, but a few use VB", Christian Graus
|
|
|
|
|
hi
i saw that page thank u
BUT
i want to use it in views.
i cant create an extra table
tanks again
|
|
|
|
|
Hi all
I have been reading through the SQL Server 2000 database book, and I know that there are 3 types of back-up database: full backup, differential backup and transaction log backup. So which one is the best recommendation?
I'd appreciate for anyone whoi can help me out!
Cheers,
Kelly
|
|
|
|
|
Kelly Giang wrote:
full backup, differential backup and transaction log backup. So which one is the best recommendation?
It depends on what you want to achieve...
A full backup creates a backup of the whole database
A differential backup creates a backup of just the differences between the last backup and now
A transaction log backup creates a backup of just the transaction log since the last backup.
Restoring a full backup means you can recover to the point of the backup. Restoring a differential backup ontop of that means you can recover to the point of the last differential backup, and a transaction log backup can be used to allow you to restore to an exact point in time or to the point of failure.
You should read the SQL Server 2000 Books-online[^] for more information.
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
Thanks a lot Colin!
Cheers,
Kelly
|
|
|
|
|
Can someone help me with this SQL statement? I'm wanting a bigint with a datetime stamp similar to:20050211102341780
Here's my SQL statement:
<br />
INSERT INTO TSK2 EXECUTE ('SELECT' ' DATEPART([YEAR], CURRENT_TIMESTAMP), DATEPART([MONTH], CURRENT_TIMESTAMP), DATEPART([DAY], CURRENT_TIMESTAMP), <br />
DATEPART([HOUR], CURRENT_TIMESTAMP), DATEPART([MINUTE], CURRENT_TIMESTAMP), DATEPART([SECOND], CURRENT_TIMESTAMP) <br />
DATEPART(MILLISECOND, CURRENT_TIMESTAMP)'' AS TSK2_DATE_TIME, 0 AS TSK2_PRIORITY, 341 AS TSK2_ACTION')<br />
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I won't claim that it is efficient but if you only use it when inserting records it shouldn't effect performance that heavily.
SELECT
CAST(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
CONVERT(VARCHAR(30),CURRENT_TIMESTAMP,21)
,'-','')
,':','')
,'.','')
,' ','')
AS BIGINT)
|
|
|
|
|
Awesome....works great!
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Is it possible to append a selected column onto the end of a selected row? For instance, I have 2 selects. The first only returns 1 row. The second returns many rows, but only in 1 column. Can I easily append all of the rows from the 2nd select onto the end of the row in the first select, without using a cursor? Even better, we'd like to concatenate all of the rows from the 2nd select into one long string, and just append that string onto the end of the 1 selects row. What might be the best approach to this?
Thanks!
|
|
|
|
|
Assuming you are using SQL Server
Here is a little sample of creating a comma delimited list from a set of rows. You can run it in SQL Query Analyzer by replacing [Name]/[Weather] with field/table of your choice. Careful that you don't pick a query that goes beyond the 8000 character limit.
This doesn't get rid of the cursor when assembling the final table since you will have to reset @sample to null at each row iteration. It does get rid of the nasty 'rows to 1 column' issue though.
DECLARE @sample VARCHAR(8000)
SELECT @sample = ISNULL(@sample + ', ','') + [Name]
FROM [Weather]
PRINT @sample
|
|
|
|
|