|
I believe that transactions are bound to the server, but I could be mistaken.
Are you using MSSQL? If so, you could create a linked server. That way you "link" the tables into the local database, giving you the option to select from both servers;
SELECT * FROM [Server].[Database].[Schema].[Table] I haven't tried this with transactions, but I guess that it could work, since all transactions can be handled local.
Good luck
I are troll
|
|
|
|
|
how to connect Access2007 to sql server ? i want to use Access as inter face. whenever i edit record in table in Access, it will affect to sql server directly. because in Access we can see nested table if that tables have relationship. so how to do with this ?
|
|
|
|
|
This[^] article describes the steps both for importing and for linking SQL Server data into Access 2007.
I are troll
|
|
|
|
|
I need some assistance with a small application. I need to loop through an existing array and to assign a value to it in a pattern. I thought that I could do it, but I am really at a loss as to how to proceed. I tried a wide variety of approaches but it does not yield the correct results.
As a smaller scale version of the array. Let us say that the array consists of 392 elements. The first element of the array consists of date values from 12/30/2007 and it proceeds up until 1/24/2009. The second element should be number values from 1 to 13.
The pattern is that there should be 28 values with the value 1, and then 28 values with the value 2, and then 28 values with the value of 3. This procedure continues with 28 values of the value 13. After the 28th value of 13, the numbering system should start over again with 28 values with the value of 1. This should populate all of the elements of the 392 element array.
The code below that I have written, for some reason, does not include the 28th value for each of these assignments. Also, it includes a 14th value following the last 13 value assignment. Please provide me with some assistance!
Public Function ZodiacPeriod(dteInputDate)
Dim dteStart As Date
Dim dteEnd As Date
Dim intDateCount As Integer
Dim intRow As Integer
Dim intX As Integer
Dim intCounter As Integer
Dim arrArray(392, 1)
intX = 1
dteStart = #12/30/2007#
dteEnd = #1/24/2009#
intDateCount = DateDiff("d", dteStart, dteEnd)
'Loading the array with dates
For intRow = 1 To intDateCount
arrArray(intRow, intColumn) = dteStart
dteStart = dteStart + 1
Next
'The second element value is assigned here
For intRow = 0 To 392
If intCounter <= 27 Then
If intX >= 14 Then
intX = 1
End If
intCounter = intCounter + 1
Else
intCounter = 1
If intX < 14 Then
intX = intX + 1
End If
End If
arrArray(intRow, 1) = intX
Next intRow
'Now to go through the array and return the value in the array
For intRow = 0 To 392
If arrArray(intRow, 0) = dteInputDate Then
ZodiacPeriod = arrArray(intRow, 1)
Exit For
End If
Next intRow
End Function
I have encountered problems in which a value of 14 is assigned. I have encountered problems in which the requirements are not matched. Any assistance would be appreciated.
|
|
|
|
|
Three points.
1. You fill the array with dates starting at index = 1, but with numbers starting at index = 0. Is this correct?
2. You could try something like
intRow = 0
For j = 1 to 13
for i = 1 to 28
intRow = intRow + 1
arrArray(intRow,1 ) = j
next i
next j
3. Wrong forum - there is a VB one (though people tend to be VB6 hostile, and this looks like VB6 or VBA to me.)
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Hi all,
I have written one article. About 3 days back. But my article status is still showing PENDING. What to do next ?
Please any one reply,
Ramesh Sambari
Knowledge is like honey.
Collect it, to make life sweet.
|
|
|
|
|
Your article is probably waiting moderation from senior members of CodeProject.
Unfortunately you have submitted it at a weekend and a public holiday for large parts of the CP community, so this might make things a little slower.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
I need to find what are the permissions on a specified folder on the computer. I need to do this by using SQL code. Is it possible to create a stored procedure to showthe permissions of a folder? if yes where can I find some examples to follow please or do someone has any examples please?
Thanks
|
|
|
|
|
That would be done by executing the ATTRIB command, through the xp_cmdshell , a stored procedure that's blocked for safety.
EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE
EXEC xp_cmdshell 'attrib "C:\Program Files"' You can read about safety here[^].
I are troll
modified on Monday, May 25, 2009 2:23 PM
|
|
|
|
|
Thanks for your reply. how can I modify this to pass the path as a parameter? I am trying to do it but there is no output.
|
|
|
|
|
You can encapsulate the commands in a stored procedure like this;
CREATE PROCEDURE ExecCmd
@PATH AS VARCHAR(1024)
AS
BEGIN
DECLARE @Command AS VARCHAR(1024)
SET @Command = REPLACE('attrib "<path>"', '<path>', @PATH)
EXEC xp_cmdshell @Command
END Calling the stored procedure with a parameter is done like this;
EXEC ExecCmd 'C:\Program Files' Good luck
I are troll
|
|
|
|
|
Thaks for the answer. It is working fine for the Program Files path. the strange thing is that it is not working for other folders that I am passing. Is only returning the folder path only, without any R or something else. And these folders have full permissions (Everyone has full permissions). Do you have an idea of what is going wrong?
Thanks
|
|
|
|
|
Sorry, my bad. The ATTRIB command returns the attributes of a file/folder. You don't want the attributes, but the effective permissions per user/windows account. These can be obtained in a similar fashion, using the CACLS command;
CACLS "C:\Program Files" Hope this helps
I are troll
|
|
|
|
|
Thanks very much. It realy works. Sry for bothering again but if I had to find only the permissions for the current user how could i modify that? only if possible? Thanks again
|
|
|
|
|
I'm afraid that's somewhat harder to do; the effective permissions aren't set for a user, but for different groups of people. That's one of the reasons why we don't check if we got permission to write to a folder, but simply write, relying on the exception-mechanism to warn when there's insufficient rights.
The only way of getting the permissions for the user, is checking whether he/she is a member of the groups that get listed. Your user may be a member of multiple groups, so that makes it somewhat more complex.
Your user can have read-access for a particular folder, based on the CREATOR OWNER group, but he/she might *also* have write permissions for *that same* folder if he/she's also a member of BUILTIN\Administrators.
That means three steps;
* Get the permissions for each group on a folder
* Check whether the user is part of that group
* Add all permissions, for each group that the user is a member of. That's the effective permission for the folder.
Good hunting
I are troll
|
|
|
|
|
Thanks again for your help. I will try to follow the steps that you have given me. thanks again thats already a great start.
|
|
|
|
|
Hi..
i am using sql server 2005 and i want to compare password field with the stiring i pass to stored procedure. like it should deny if 'Hemant' = 'hemant'
please suggest me
thanks
Hemant
By:
Hemant Thaker
|
|
|
|
|
A simple google for sql string compare casesensitive returned this[^].
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hai All,
To take backup of a database I need to go to shell> prompt from mysql> how ca i move? I am using windowsXP OS?
Plese any body knows about this?
Ranjith
|
|
|
|
|
A Real Work at Home Opportunity as an Independent Advertising Executive. We offer home workers the opportunity to earn extra money from the comfort of their own home. Visit Us at http://www.clicknearn.net/idevaffiliate/idevaffiliate.php?id=2482_9
|
|
|
|
|
"Vote to remove"
I are troll
|
|
|
|
|
HI All, i wish begin to work about a feature new for me ,i'n my project i have a database( with SqlServer) and an application (developing in WPF) the purpose of this application is to manage/handle about Accountancy and others Departement,so i created a Passwords and Roles(for Users) to access in the application ,now i will create a system to knows how many Users are connected to the Application(via Database )and show that in a listBox(for example like a normal Chat Application i wish knows who is online and offline) but i don't know where i need begin to work out this feature ,i'm strange to this feature so if you have any suggestion,link and help i will appreciate so much your help.
Thanks so much.
P.S. if my question is not clear i will rewrite it...however sorry in anticipate
Best Regards Smile
|
|
|
|
|
That's a large and complex problem. I'd suggest breaking it apart into smaller problems, like;
* maintain a list of users in the database
* put a "marker" on those user-records who signed in, and removing it when they log out
* displaying a list of users who got the "I'm logged in" marker (who's online now-query)
* send a message to a user (what will you do if the user signs out before the message is delivered?)
* ..etc
Good luck
I are troll
|
|
|
|
|
I'd suggest you maintain a table of who log on/off your application and use this as the basis for your solution.
Every time someone logs on, add them to the table. Everytime the log off, remove them from the table.
You can then do a simple
select satement to get a list of all the logged on users and display that in a list box.
|
|
|
|
|
Thanks do much for you help,
now i try to put in action your advice hoping to work out this feature if i can't i will tell you about my error.
Have a happy work.
Nice Regards.
|
|
|
|