Vba Access 2007

Mar 12, 2008

I want to user 'acCmdExportFixedFormat' in ms-access to save reports as PDF and XPS.
when i use the code runcommand acCmdExportFixedFormat i have to set manually the filename.
I want to give the filename in my vba code. How do i user this

View 4 Replies


ADVERTISEMENT

How To Get Receipients Email Address In Access 2007 Table From Outlook 2007 Using VBA?

Mar 3, 2008

Hi
everybody.
I am new to VBA,.,, I Have created a folder under inbox in Outlook 2007 which stored the receipients information
like name, E-mail, which is not present in the address book of outlook.
I have imported this folder in access 2007. My problem is ... it does not display the email address.
Rest of the informations is displayed... Is there any way i could do this.??
is there any way i could get the email addresses to appear(import/get) in to the access table???
Is there any module i mite have to create??

Plz help...
thanks a million

View 1 Replies View Related

Access 2007 Linked Tables (vs Access 2003)

May 15, 2007

We migrated a MS Access 2003 mdb into MS Access 2007. The mdb has linked tables to SQL Server via a DSN and utilizes a mdw file. In 2003, the username/password is "passed" to SQL Server, so the UID/PWD that is used for opening the mdb, is used in SQL Server.



Opening the same file in 2007 using the same mdw, gives a secondary login on SQL Server.



Is there a way to have MS Access 2007 pass the UID/PWD to SQL Server on linked tables, the same way that 2003 does?



Thanks!

View 1 Replies View Related

Connecting Access 2007 Via .NET

Oct 26, 2006

Is there any way that I can connect an Access 200? front end through .NET?

View 1 Replies View Related

Problem With VBA When Converted To Access 2007

Apr 8, 2008

I converted my database to 2007 version and when I tried to execute VBA Module which adds records from one table to another it showed me a mistake (Type mismatch) Here is the code (it worked on 2003 version). Can anybode help me to fix the error?

Function AddBulletin()
Dim st As String
Dim i As Integer
Dim db As Database
Dim Table1 As Recordset
Dim Table2 As Recordset
DoCmd.OpenTable "Today", acNormal, acEdit
DoCmd.ApplyFilter "", "[Today]![F3] Is Null"
DoCmd.RunCommand acCmdSelectAllRecords
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.Close acTable, "Today"
Set db = DBEngine.Workspaces(0).Databases(0)
Set Table1 = db.OpenRecordset("Today", dbOpenDynaset)
Set Table2 = db.OpenRecordset("BULLETINS", dbOpenDynaset)

The mistake appears on the last two rows.
It's probably easy but I cannot find it.

View 1 Replies View Related

MS Access 2007 && SQL Server 2005

Apr 16, 2007

Hi,



I have a problem with connecting to our SQL Server 2005 through Access 2007. I get a msg "ODBC-- failed. [Microsoft][ODBC SQL Server Driver][SQL Server] SELECT permission denied on object 'clients', database 'Contacts', schema 'dbo' (#229)" We have moved some of our tables from Access over to SQL Server 2005. I recently got Access 2007 and I'm the only one at the office that has this problem (everyone else uses Access 2003 or older). I can link tables to SQL Server but I can't open them and I can't open Forms or Reports that has those tables as data source. I can open other objects in Access that are not linked to SQL Server.



Does anyone know why this is?



Thanks Charlotte

View 3 Replies View Related

Access 2007 + SQL Server 2005 + Vista X64

Sep 5, 2007

Hello,

I am looking for a solution to the problem named Table was skipped, or export failed. Here's the story:

I have a desktop with Vista Ultimate x64 and Office 2007. I want to export a database from Access MDB (about 2Gb, 110 tables) to SQL Server Express Express (Advanced). The simple solution > upsize wizard.

- create new database
- server name, used trusted connection, some database name
- I select all tables
- I unselect table's attributes
- create new Access server/client application
and every time I have Table was skipped, or export failed. The same thing happens when I create new MDB with one table (some random values)!

The strange thing that on laptop with XP + SQL Sever 2005 Express (Simple) and Access XP upsizing the same database works fine!'

one other issues of a rookie:
I wanted to access a database (randomly created) on Vista with the Access on my laptop. Both PCs are in the same network I can ping both, but when I try to connect to IP_desktopSQLEXPRESS Access posts connection error. Why?

P.S.
When installing SQL Server on Vista I have only a problem with IIS and ASP.NET, but it shouldn't be a problem.

View 1 Replies View Related

Access 2007 Connection To SQL 2000 REALLY Slow

Dec 19, 2006

I have an Access2000 ADP that I want to run under Access2007. The problem I have is that some forms take up to 45 seconds to open in Access2007! These are not complicated forms--just simple navigable reference forms like setting up transaction types etc. that are based on basic select statements like:

SELECT * FROM ArReceivableType

Where ArReceivableType is a reference table (less than 10 columns, all int or nvarchar(100) max) containing about 15 or 20 rows. They open instantly in Access2000.

I put a trace on to see what is happening on the SQL Server, and I noticed heaps of nasty code like this that generates tens of thousands of reads:

select object_name(sotblfk.id), user_name(sotblfk.uid), object_name(sotblrk.id), user_name(sotblrk.uid) from sysreferences srfk, sysobjects sofk, sysobjects sotblfk, sysobjects sotblrk where srfk.constid = sofk.id and srfk.fkeyid = sotblfk.id and srfk.rkeyid = sotblrk.id and user_name(sofk.uid) = N'dbo' and object_name(sofk.id) = N'FK_FaAssetTransactionWork_ArReceivableType_ArReceivableTypeId'

It looks like Access2007 is reading all of the constraints for the underlying table, including all foreign keys. My SQL database contains 1400+ tables all with properly constructed foreign keys and other constraints.

Any suggestion on how to NOT have Access2007 do this? Right now, Access2000 works great for this enterprise app, but I really like the new Access2007 features (and I don't want to still be developing Access2000 apps in 2010).

View 3 Replies View Related

MS Access 2007 Db Upsizing T0 SQL Server Express 2008

Apr 24, 2008

Hi Folks,
I have an access 2007 data base for document control and it saves the received documents in a table in a attachment field type, I tried to upsize it to SQL Server 2005 but after upsizing realized that this field type is not supported by 2005 so I downloaded the SQL Express 2008 and installed it as it has this enhancement but Access 2007 doesn’t recognize the server for upsizing.
I appreciate you help
Thanks :beer:

View 13 Replies View Related

New Data Source VB2005 And Access 2007 Beta

Aug 17, 2006

Well I'm hoping I'm asking this in the right place. But probrably not. I am using VB2005 express and have Access 2007 beta. When I try to add a new data source VB is looking for a .mdb database type. However Access 2007 beta uses .accdb. I'm not sure how to get these two talking since in the vb drop down boxes all it list is a connection on access with .mdb and all files. When I try all files and pick the accdb data I get the "Couldn't connect with data sorce c:blahblah/bills.accdb.mdb. This an error or am I just totally off the mark? Any help would be appreciated.

View 2 Replies View Related

How To Create Linked Server To Access 2007 Accdb File?

Feb 20, 2008

How does one create a linked server to an Access 2007 (accdb) file? I am aware that to create one to a mdb file, the code would be -EXEC sp_addlinkedserver
@server = 'SEATTLE Mktg',
@provider = 'Microsoft.Jet.OLEDB.4.0',
@srvproduct = 'OLE DB Provider for Jet',
@datasrc = 'C:MSOfficeAccessSamplesNorthwind.mdb'
GO
What is the corresponding code for Access 2007 accdb files?

View 18 Replies View Related

Access 2007 Runtime: Stored Procedures As Record Source

Feb 15, 2008


Hello

In our company, after switching to Office 2007, Access 2007 runtime is installed on our general user machines.
Everything is just fine and beautiful, except that there is one issue with runtime:

Several forms in my Access Project use stored procedures in SQL Server 2000 as their record source. When i try to open the forms in Access 2007 Runtime on user machines, i receive an error that "The record source dbo.Myprocedure speified on this form or report does not exist ".
I use dbo.ProcName format and the forms open correctly in my full version Access.
What could be the problem?

Thanks!

Elman

View 10 Replies View Related

'microsoft.ace.oledb.12.0' Access Denied When Exporting Data To Excel 2007

May 10, 2008

I have a stored proc that runs and produces an Excel 2007 file. I can run it fine within SQL Server Management Studio.
Basically, this is a partial code in the stored proc:


-- export sql server table data to excel 2007

insert into OPENROWSET('microsoft.ace.oledb.12.0',

'Excel 12.0;Database=D: emp est2007.xlsx;',

'SELECT * FROM LicensesrRegion') select * from Licenses

BUT when I have an execute SQL task to run that stored proc in an SSIS package, I received the following error:
Ad hoc access to OLE DB provider 'microsoft.ace.oledb.12.0' has been denied. You must access this provider through a linked server.

Please advise.

PS: I have to run that stored proc in an SSIS package because the SSIS package does some prereq stuff ( create folder, copy template to new Excel output file) then finally calls the aforementioned stored proc.

Thank you in advance.

Thanks!

View 6 Replies View Related

ODBC Connection From Access 2007 Database To SQL Server 2005 Database

Feb 29, 2008

I need detailed instructions on how to connect to a database from a Microsoft Access 2007 database to a Microsft Office Accounting 2007 database. The accounting database is an SQL 2005 datbase. It has an instance name of "MSSMLBIZ".

When I try I get an SQL error 53. Do not have permissions or database does not exist.

Thanks in advance for any help.,

View 1 Replies View Related

SQL 2007 Error

Feb 20, 2007

Hi everyone,
I am new to SQL Server. I have SQL 2007 installed on win 2003 server, my problem is when I try to start the Sql 2007 server I get the error message "The service control action cannot be completed as no service has been selected"
Thanks in advance
Arunchu from London

View 4 Replies View Related

RS In Sharepoint 2007

Jan 22, 2007

Sharepoint Server Portal 2007, MSSQL 2005, Reporting Services

When I try to integrate Reporting Services in Adminitsrator, for url of RS I write this: http://servername/ReportServer/ and click OK.

But when I try to go to 'Set Server defaults' or 'Managed Shared Shedules' I get this:

Server was unable to process request. ---> Client found response content type of '', but expected 'text/xml'. The request failed with an empty responseWhat should I Do ?

View 1 Replies View Related

BCM With Accounting 2007

Feb 1, 2007

I have bcm with outlook 2007 and accounting express. when i create an opportunity in bcm, everything is fine. when i click the convert to quote button, it dumps all of the item information (quantity, name, description, price, tax....) into the description field in accounting. Then I have to copy each piece out of the description field into it's appropriate field in accounting 2007 express. Where is the mapping for these fields, so that I can map each one correctly? Is there something else i should be doing?

View 1 Replies View Related

Moneycount 9 To Quickbooks 2007

Mar 18, 2007

Can Moneycounts 9.0 (data) be imported to Quickbooks 2007? If so How?

View 2 Replies View Related

Backup Sharepoint 2007

Jun 12, 2008

I know this is not SQL server related. Do anyone know good Third-party tools to backup sharepoint 2007? I have looked at www.avepoint.com and ideras tools but didn't find price listings. I am looking which has reasonable price and efficient.
Only xpurt ownly

View 4 Replies View Related

Access07 To SQL Server 2007 Through The...

Dec 2, 2007

hi everybody
I've been working in the database field for 9 months
I started from very simple tables, to some sql stuff
And then I started studying SQL Server 2005 extensively until I took MCTS SQL Server 2005
During that time, I was building a database for a new company from scratch, and while I build it for them I keep on reading books and learning, and using this knowledge to upgrade the database
Recently, I could successfully migrate the back-end to SQL Server 2005, and after days of struggling I could connect the front end to it via ODBC in a LAN
My next step is connecting the database through the internet, so I just changed the server name in the DSN file to the address of the server, and opened the ports, but it didn't work....
Can you tell me what's the problem?
Is there a book that can help me do this thing?
I can buy any book and I have the will to learn, provided that I'll apply for MCITP Database Developer next months

Thank you..

View 20 Replies View Related

SCE 2007 And Server 2000

Mar 24, 2008

I have installed System Center Essentials on our network. Everything seems to be working but we are now getting Perflib errors (event id 1008) on our windows 2000 servers. This error indicates there is a problem with our ASP.net v2.xx.xx.xx. We have been unable to resolve this and are looking for more things to try.



View 5 Replies View Related

Openrowset Excel 2007

Jul 31, 2007

Haven't been able to find much information on using openrowset with excel 2007 xlsx files. I've tried the following with no success so far.

SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0 Xml;Database=\serverfolderfile.xlsx;HDR=No;IMEX=1',
'SELECT f1 FROM [Raw Keywords$] WHERE f1 IS NOT NULL')

If anyone knows the correct way to do this please tell me.

View 3 Replies View Related

RS Web Parts On SharePoint 2007

Feb 20, 2007

Hi,

I'm having troubles connecting the webparts on SharePoint 2007. I installed the RSWebParts package from SQL Server 2005 Reporting Services on my MOSS 2007 box. The installation went smoothly and I can add both Report Explorer and Report Viewer on a page. But when I try to connect RE to RV I get the following error:


An unexpected error has occurred.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.

So I have to go to the maintenance page and remove the web parts.

Have anyone managed to bypass this and make them work together?

Thanks,

View 1 Replies View Related

SQL For Equipment Up Time During 2007

Dec 20, 2007



I have a table with equipment ID, transaction ID, date of transaction. How can I write a sql so that the result is a list of
equipment with % up time during 2007.
Transaction ID: 100 is down, 200 is up. Example is below the table

Equipment ID Transaction ID Date
1 200 1/12/2007
2 100 2/12/2007
1 100 2/25/2007
3 100 3/10/2007
2 200 3/14/2007

From the table I know that equiment 2 was down for 32 days and up time % during 2007 is (365-32)/365*100

How can I write a sql in order to achieve that

Daniel
sql learner

View 8 Replies View Related

Mirroring With MOSS 2007

Oct 31, 2007





Is anyone attempting or has anyone successfully deployed MOSS2007 with a SQL 2005 Database Mirror on the backend? We are doing it in our lab with the automatic failover (principal, mirror & witness) and the SQL portion works great. The only issue is we have is that we have to manually switch MOSS over (via Sharepoint 3.0 Central Admin or stsadm) to the new content database on the other server. Thank you


We have reviewed the White Paper that Microsoft offered with no help to our issue.

View 1 Replies View Related

Excel 2007 And SqlServer Sp2

Feb 21, 2007

hellow all,

i installed SqlServer 2005 sp2 on my server.

now, how do i import excel 2007 files in SSIS? i don't have office 2007 installed on my computer, but i've got some .xslx that i would like to try ro import. i tried to create an OLEDB connection, but i don't know which provider to choose.

anyway, can i do it without the sp2 or office 2007 installed on my server?

thanks for tour reply!

View 5 Replies View Related

Trigger Is Not Working After 12/21/2007

Jan 16, 2008

Hi Experts,
The trigger is not sucessfully calling the Stored Procedure. This was working up until last year (12/21/2007 @ 1600 hrs.)Here I am providing codes for both Trigger and Storedprocedure.Can you help me out where the problem is?

Trigger

USE [personnelreq]
GO
/****** Object: Trigger [tgrTracking] Script Date: 01/16/2008 11:55:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO



/*****************************************************************************************************************************************************************
* Trigger Name: tgrTracking
* Description: Calls the CalcTrackingHours stored procedure for replacement and net staff addition
* requisitions when the requisitions are emailed, transferred, or completed.
* History
* TKT/CO # Date Developer Description
* ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 01/03/2005 Zsofia Horompoli Created
* CO#1570 03/22/2005 Zsofia Horompoli Added originator email tracking for transfer events
*****************************************************************************************************************************************************************/
CREATE TRIGGER [tgrTracking] ON [dbo].[Log2]
FOR INSERT
AS

DECLARE @reqId int -- store requisition ID
DECLARE @eventId int -- event value inserted
DECLARE @parentId int -- store parent requisition ID
DECLARE @eventTime datetime -- store date/time of event
DECLARE @email varchar(50) -- store email address
DECLARE @logId int -- store ID assigned to the record in the Log2 table
DECLARE @location varchar(30) -- Location
DECLARE @title varchar(30) -- Job title
DECLARE @multiReq int -- > 0 = Multi NSA
DECLARE @origMail varchar(50) -- Originator's email address
DECLARE @subject varchar(200) -- Email subject line
DECLARE @from varchar(50) -- From email
DECLARE @body varchar(8000) -- Email body
DECLARE @reqType int -- Requisition type (0-replacement, 1-net staff addition, 6-Bonus)
DECLARE @sReqType varchar(30) -- Requisition type description
DECLARE @appEmail varchar(500) -- Approvers' email addresses

SELECT @from = 'compensationandbenefits@west.com'

DECLARE @inserted_rows AS CURSOR -- hold the inserted rows
SET @inserted_rows = CURSOR FOR
SELECT id,reqid, timestamp, event, stuff(notes,1,patindex('%:%',notes),'') AS email FROM inserted -- get the Log2 id,requisition id, event, timestamp, and email address from the updated/inserted rows

OPEN @inserted_rows
FETCH NEXT FROM @inserted_rows INTO @logId, @reqId, @eventTime, @eventId, @email
WHILE (@@FETCH_STATUS = 0)
BEGIN
--Is this an email/transfer/complete/deny event?
IF (@eventId = 4 OR @eventId = 6 OR @eventId = 7 OR @eventId = 0 OR @eventId = 10)
BEGIN -- Yes, is this a deny event?
IF (@eventId = 0)
BEGIN --Yes, is this an active replacement/net staff addition/parent multi NSA requisition?

SELECT @parentId = id
FROM reqs2 r
WHERE requisitiontype in (0,1) and id = @reqId and
(SELECT ParentReqId from ParentChild WHERE ChildReqId = @reqId) IS NULL and
NOT (markedfortransfer = 0 AND logging <> 1) AND markedfortransfer <> 2
END
ELSE IF (@eventId = 6)
BEGIN
SELECT @parentId = id
FROM reqs2 r
WHERE requisitiontype IN (0,1,6) AND id = @reqId AND
(SELECT ParentReqId FROM ParentChild WHERE ChildReqId = @reqId) IS NULL and
NOT (markedfortransfer = 0 AND logging <> 1) and
(SELECT id FROM Log2 WHERE reqId = @reqId AND event = 0) IS NULL
END
ELSE IF (@eventId = 7 OR @eventId = 10)
BEGIN
SELECT @parentId = id
FROM reqs2 r
WHERE requisitiontype IN (0,1) AND id = @reqId AND
(SELECT ParentReqId FROM ParentChild WHERE ChildReqId = @reqId) IS NULL and
markedfortransfer <> 2 and
(SELECT id FROM Log2 WHERE reqId = @reqId AND event = 0) IS NULL
END
ELSE
BEGIN -- No, is this an active replacement/net staff addition/parent multi NSA requisition?
SELECT @parentId = id
FROM reqs2 r
WHERE requisitiontype IN (0,1) AND id = @reqId AND
(SELECT ParentReqId FROM ParentChild WHERE ChildReqId = @reqId) IS NULL and
NOT (markedfortransfer = 0 AND logging <> 1) AND markedfortransfer <> 2 and
(SELECT id FROM Log2 WHERE reqId = @reqId AND event = 0) IS NULL
END

--Is this a requisition to be tracked?
IF @parentId is not NULL
BEGIN --Yes, is this a transfer event?
IF @eventId = 6
BEGIN --Yes, retrieve information for email
SELECT @location = RTRIM(L.DESCR), @title = RTRIM(PT.DESCR), @multiReq = (SELECT COUNT(*) FROM ParentChild WHERE ParentReqID = R.id), @reqType = R.requisitiontype
FROM reqs2 R
LEFT OUTER JOIN TDSdev.dbo.PS_LOCATION_TBL L ON R.sitename = L.LOCATION
LEFT OUTER JOIN TDSdev.dbo.PS_JOBCODE_TBL PT ON R.jobtitle = PT.JOBCODE
WHERE R.id = @reqId

-- Get email addresses to use
EXEC sel_EmailUsers @reqId = @reqId, @bApprover = 1, @currentUser = NULL, @origEmail = @origMail OUTPUT, @appEmail = @appEmail OUTPUT

--Set requisition type description
IF @reqType = 0
BEGIN --Replacement requisition
SELECT @sReqType = 'Replacement'
END
ELSE IF @reqType = 1 AND @multiReq > 0
BEGIN --Multi-NSA
SELECT @sReqType = 'Multiple Net Staff Addition'
END
ELSE IF @reqType = 1
BEGIN --NSA
SELECT @sReqType = 'Net Staff Addition'
END
ELSE IF @reqType = 6
BEGIN --Bonus
SELECT @sReqType = 'Bonus'
END

--Build subject line
--Do we have a location?
IF @location IS NULL
BEGIN --No, default to Nothing
SELECT @location = ''
END

--Do we have a job title?
IF @title IS NULL
BEGIN --No, default to Nothing
SELECT @title = ''
END

SELECT @subject = @location + ': ' + @sReqType + ': ' + CAST(@reqId AS varchar(15)) + ': ' + @title

--Set email body
IF @reqType = 6 -- If Bonus Req
BEGIN
SELECT @body = '<p>Bonus requisition number ' + CAST(@reqId AS varchar(15)) + ' has been processed by Compensation.</p>'
SELECT @body = @body + '<p>If you have any questions, please contact us at <a href=''mailto: compensationandbenefits@west.com'' target=''_blank''>compensationandbenefits@west.com</a> .</p>'
END
ELSE IF @reqType IN (0,1) -- If Net Staff or Replacement Req
BEGIN
SELECT @body = '<p>Requisition number ' + CAST(@reqId AS varchar(15)) + ' has been finalized and sent to Human Resources on ' + convert(char(10),@eventTime, 101) + ' at ' + substring(convert(char(19),@eventTime, 100), 12, 8) + ' for recruiting.</p>'
SELECT @body = @body + '<p>If you have any questions, please contact us at <a href=''mailto: compensationandbenefits@west.com'' target=''_blank''>compensationandbenefits@west.com</a> .</p>'
END

--Send email
EXEC usp_SMTPMail @SenderAddress = @from, @RecipientAddress = @origMail, @Subject = @subject, @Body = @body, @Cc = @appEmail
END

-- Call the CalcTrackingHours stored procedure
IF @reqType IN (0,1)
BEGIN
EXEC CalcTrackingHours @event = @eventId, @reqId = @reqId, @emailTo = @email, @endDateTime = @eventTime, @logId = @logId
END
END
END
FETCH NEXT FROM @inserted_rows INTO @logId, @reqId, @eventTime, @eventId, @email
END

--clean up
CLOSE @inserted_rows
DEALLOCATE @inserted_rows


Stored Procedure is

USE [personnelreq]
GO
/****** Object: StoredProcedure [dbo].[CalcTrackingHours] Script Date: 01/16/2008 12:01:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
/****** Object: Stored Procedure dbo.CalcTrackingHours Script Date: 4/12/2005 9:20:19 AM ******/


/*****************************************************************************************************************************************************************
* Stored Procedure Name: CalcTrackingHours
* Description: Determines the appropriate tracking level, the number of business hours the requisition
* spent at the current tracking level and inserts this information into the timeLog table
* History
* Date Developer Description
* ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 01/03/2005 syszxh Created
*****************************************************************************************************************************************************************/
CREATE procedure [dbo].[CalcTrackingHours]
@event int, -- 4=Emailed,6=Transferred,7=Completed
@reqId int, -- Requisition Id
@emailTo varchar(50), -- Email address requisition was forwarded to
@endDateTime datetime, -- Date/time of event
@logId int -- ID assigned to new record in the Log2 table
as
set nocount on

declare @currentUserType as int -- Current user type
declare @startDateTime as datetime -- Date/time requisition arrived at current step
declare @newUserType as int -- New user type
declare @currentTrackLevel as varchar(5) -- Tracking level to be inserted into the timeLog table
declare @newTrackLevel as varchar(5) -- New tracking level
declare @trackEmail as varchar(50) -- Email address at current tracking level
declare @count as int -- counter variable
declare @errorValue as int -- Error flag (1 = start date/time missing)
declare @trackHours as decimal(10,2)

select @errorValue = 0
select @startDateTime = NULL

-- Retrieve last email's user type, date/time stamp, and email address
select top 1 @currentUserType = userType, @startDateTime = timestamp, @trackEmail = n.userid
from personnelreq.dbo.Log2 l left outer join personnelreq.dbo.names2 n on stuff(notes,1,patindex('%:%',notes),'') = n.userid
where (l.event = 4 or l.event = 10) and timestamp <= @endDateTime and reqid = @reqId and l.id < @logId order by l.id desc

-- Last email found?
if @startDateTime is NULL
begin
-- No, this is the very first email, retrieve new user type
select @newUserType = userType
from personnelreq.dbo.names2 n
where userid = @emailTo

-- Is new user @C&B?
if @newUserType = 2
begin -- Yes, set new tracking level
select @newTrackLevel = 'cb1'
end
else
begin -- No, set new tracking level
select @newTrackLevel = 'dept'
end
end
else
begin
-- Is this event = email?
if @event = 4
begin
-- Retrieve new user type
select @newUserType = userType
from personnelreq.dbo.names2 n
where userid = @emailTo

-- Is the current user the same as the new user?
if @currentUserType = @newUserType and @emailTo = @trackEmail
begin
-- Yes, get latest level
select top 1 @newTrackLevel = trackLevel
from timeLog
where reqID = @reqId and trackEmail = @trackEmail and dateIn = @startDateTime
order by dateIn desc

select @currentTrackLevel = @newTrackLevel
end
-- Is the current user type @C&B?
else if @currentUserType <> 2 or @currentUserType is NULL
begin
-- No, retrieve current tracking level
exec GetTrackLevel @userType = @currentUserType, @reqID = @reqID, @email = @trackEmail, @trackLevel = @currentTrackLevel output
-- Is the new user type @C&B?
if @newUserType = 2
begin -- Yes, retrieve new tracking level
exec GetCBLevel @trackLevel = @currentTrackLevel, @reqID = @reqID, @currentTrackLevel = @newTrackLevel output
end
else -- No, retrieve new tracking level
begin
exec GetTrackLevel @userType = @newUserType, @reqID = @reqID, @email = @emailTo, @trackLevel = @newTrackLevel output
end
end
else
begin
-- Yes, retrieve new tracking level
exec GetTrackLevel @userType = @newUserType, @reqID = @reqID, @email = @emailTo, @trackLevel = @newTrackLevel output
-- Retrieve current tracking level
exec GetCBLevel @trackLevel = @newTrackLevel, @reqID = @reqID, @currentTrackLevel = @currentTrackLevel output
end
end
-- Is this event = transfer/completed?
else if @event = 6 or @event = 7 or @event = 10
begin
-- No, any existing entries for exec3?
if (select count(*) from timeLog where trackLevel = 'exec3' and reqID = @reqID) > 0
begin
-- Yes, set current tracking level to cb5
select @currentTrackLevel = 'cb5'
end
-- Any existing entries for exec2?
else if (select count(*) from timeLog where trackLevel = 'exec2' and reqID = @reqID) > 0
begin
-- Yes, set current tracking level to cb4
select @currentTrackLevel = 'cb4'
end
-- Any existing entries for exec1?
else if (select count(*) from timeLog where trackLevel = 'exec1' and reqID = @reqID) > 0
begin
-- Yes, set current tracking level to cb3
select @currentTrackLevel = 'cb3'
end
-- Any existing entries for acct?
else if (select count(*) from timeLog where trackLevel = 'acct' and reqID = @reqID) > 0
begin
-- Yes, set current tracking level to cb2
select @currentTrackLevel = 'cb2'
end
else
begin
-- Set current tracking level to cb1
select @currentTrackLevel = 'cb1'
end
end

-- Calculate hours worked
if @event <> 10
begin
exec CalcBusinessHours @startDateT = @startDateTime, @endDateT = @endDateTime, @totalHours = @trackHours output

-- Update information in the timeLog table
update timeLog
set dateOut = @endDateTime, trackHours = @trackHours
where reqID = @reqID and trackHours = 0 and dateOut = '1990-12-31'
end
end

-- Is this event = email?
if @event = 4 and @newTrackLevel is not NULL
begin
-- Yes, insert new row for new track step
insert into timeLog (reqID, trackLevel, dateIn, trackEmail, trackHours, dateOut)
values (@reqID, @newTrackLevel, @endDateTime, @emailTo, 0, '1990-12-31')
end
-- Is this event = reopen?
else if @event = 10 and @trackEmail is not NULL
begin -- Yes, insert new row for new track step
insert into timeLog (reqID, trackLevel, dateIn, trackEmail, trackHours, dateOut)
values (@reqID, @currentTrackLevel, @endDateTime, @trackEmail, 0, '1990-12-31')
end


endProcedure:
Return @errorValue

View 2 Replies View Related

Importing Excel 2007

May 15, 2008



When importing an .xlsx file the number of columns stops at 255. Does anybody know how to get all columns imported?

Tried saving the file as text and that allows me to import all the columns but it would be much easier to do this directly from Excel.

Thanks

View 4 Replies View Related

Export To Excel 2007

Jul 17, 2007

Hello Everyone,



Is there any way in RS2005 to export to Excel 2007 format ?



The reason I'm asking is that we have a report that can potentially have more than 256 columns but for now, there is no way of directly importing to excel 2003 (.xls).



Is microsoft going to come out with an improvement to RS2005 or is there already a way to export to Excel 2007 to bypass the 256 column limit?





Regards,

Joseph

View 1 Replies View Related

Excel 2007 And SSIS

Feb 28, 2008



Hi Folks,
I have got a quick question, Is it possible to use office 2007 in SSIS, If so what would be the driver?
or Could we use JET 4.0 itself?

Any thoughts and help in this regard would be appreciated.

Zulfi.

View 3 Replies View Related

Sharepoint 2007 &&amp; DB Mirroring

May 8, 2007

I am trying to work through a test on database mirroring I am following the whitepaper that Micrososft published on how to configure mirroring and sahrepoint, but when i failover the config database and admin content database it doesnt appear to work. I execute the following commands after both are failed over

----

stsadm.exe -o renameserver -oldservername <OldPrincipalServer> -newservername <NewPrincipalServer>

iisreset

----

It doesnt work it get the following error.

Unable to connect to database. Check database connection information and make sure the database server is running.

When i bring the admin content databse back to the original principle the admin site works great.

What am I missing?

View 3 Replies View Related

Office 2007 And SSIS

Oct 4, 2007

Help! My network support staff just upgraded my MS Office products from Office 2003 to Office 2007, and now I no longer get the "F5 = Run" option in Microsoft Visual Studio to run any of my SSIS packages that ran just fine yesterday, before the upgrade.

The "Debug" option does not occur in the menu choices across the top of the screen. (They are File, Edit, View, Project, Build, Data, Format, SSIS, Tools, Test, Window, Community, and Help -- no Debug.)

I store my packages in the File System. I can run many of them just fine, even today, with the Execute Package Utility. My problem occurs when I try to run them in Visual Studio.

Even if I make a simple, new package that moves a table from Access 2003 to SQL Server 2005, I see no Debug menu selection option when I am finished with the new package.

I figure it must be something simple -- I just don't know where to find it in the Visual Studio menu.

Most of the packages I am trying to run do not access Office files: they access dBase 5 files (database); they run processes on SQL Server 2005 servers. I realize that I may have to make some adjustments to connections to Access databases, should such databases be upgraded to Office 2007.

Thanks in advance.

Dan

View 9 Replies View Related

How To Compare 2007-9-11 And Month(GetDate()) ?

Oct 30, 2007

I am going to compare thie value 2007-9-11 (this value was retrived from the column(TxnDate) in my DataBase, type is DateTime)
I write code  
select * from ZT_ModifyLog where Year(TXnDate) =  Year(GetDate()) AND (  ( Month(TXnDate) < Month(GetDate()) )  and Month(TXnDate) >= Month(GetDate())-1)
it will like
select * from ZT_ModifyLog where Year(2007-9-11 ) =  Year(GetDate()) AND (  ( Month(2007-9-11 ) < Month(GetDate()) )  and Month(2007-9-11 ) >= Month(GetDate())-1)
→  select * from ZT_ModifyLog where TxnDate(2007) = 2007 AND 10 < GetDate(10)  and 9 >= 9   so return TXnDate between 2007/9/1~ 2007/9/30
 but what if Month(GetDate())-13)?? when the -1 biger than 12... I guess the code will cause error ... but can't think out how to avoid and change my code
 
pleae help... thank you very much

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved