Sunday, March 25, 2012
ActiveX to copy and rename file
I'm looking to use ActiveX in a DTS to copy a file from on elocation to another.
I have the code for this (attached below kindly supplied by a colleague), so that's cool.
dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("D:\Credits\Credits_MTD.mdb") Then
filesys.CopyFile "D:\Credits\Credits_MTD.mdb", _
"C:\Credits\Credits_200602.mdb"
End If
But what I'm looking to do is go one step further.
As you can see, it renames the file to yyyymm, but this is hard coded, and I'm looking for a coded solution so I can rename the file with yesterday's date.
Can anybody help me please?declare a variable path,get year,month,day-1 from system date,concatnate all and concatnate again with ur file path.
pass that variable.|||Cheers - sorry to be a apin but is it something like this:
dim newDate
newDate = FormatDateTime( Now()-1 , yyyymmdd )
....\Credits_" & NewDate & ".mdb"
I tried that, and it came back with Path Not Found|||Cheers - sorry to be a apin but is it something like this:
dim newDate
newDate = FormatDateTime( Now()-1 , yyyymmdd )
....\Credits_" & NewDate & ".mdb"
I tried that, and it came back with Path Not Found
Unforunatly I dont have vb platform to test it.
create the variable first and pass that variable.
dim path
path="C:\Credits\Credits_"&NewDate&".mdb"
filesys.CopyFile "D:\Credits\Credits_MTD.mdb", path|||Cheers,
Will try that now.
ActiveX Script
Function Main()
ms_year = year(date())
ms_month = month(date())
ms_day = day(date())
ms_date = ms_year & "_" & ms_month &"_" & ms_day & "_"
dim objFSO, strFullNm
set objFSO = CreateObject("Scripting.FileSystemObject")
strFullNm = DTSGlobalVariables("FilePathRoot").value & "\IMS_ALL_DONATIONS.txt"
'check to see if file exist and then concatenate the file
if objFSO.FileExists(strFullNm) then
strFullNm = DTSGlobalVariables("FilePathRoot").value & "\ " & ms_date & "IMS_ALL_DONATIONS.txt"
MsgBox "This is the new filename: " & strFullNm
else MsgBox "File does not exist"
end if
set objFSO = nothing
Main = DTSTaskExecResult_Success
End FunctionUm, I'm not sure exactly what you are trying to achieve here.
You say the correct filename is being displayed but strFullNm is not being set to the right value, is that right??
After you display strFullNm what are you doing with it? Looking at the code you have there you aren't doing anything with it at all and it will be discarded. Are you trying to rename a file or move a file or something?
ActiveX from SQL?
I'm trying to use ActiveX from SQL to save an Excel file. I use the
following code:
Set xlApp = CreateObject("Excel.Application") Set xlWb =
xlApp.Workbooks.Open("C:\Report.xls")
' make some changes here to the file ...
xlWb.Save
Since the file already exist and I am making changes to it, the 'Save'
command will trigger a prompt and I have to answer 'yes' to the Excel
question 'File already exists. Do you want to replace this file?'
Does the Save command or another command accept a parameter so it will
overwrite the file without the prompt?
THANKS!!it does not overwrite the file without the prompt.
Because It occur security web browser.
cheers...
"Dean J Garrett" wrote:
> Hello,
>
> I'm trying to use ActiveX from SQL to save an Excel file. I use the
> following code:
> Set xlApp = CreateObject("Excel.Application") Set xlWb =
> xlApp.Workbooks.Open("C:\Report.xls")
> ' make some changes here to the file ...
> xlWb.Save
> Since the file already exist and I am making changes to it, the 'Save'
> command will trigger a prompt and I have to answer 'yes' to the Excel
> question 'File already exists. Do you want to replace this file?'
> Does the Save command or another command accept a parameter so it will
> overwrite the file without the prompt?
>
> THANKS!!
>
>|||it does not overwrite the file without the prompt.
Because It occur security web browser.
cheers...
"Dean J Garrett" wrote:
> Hello,
>
> I'm trying to use ActiveX from SQL to save an Excel file. I use the
> following code:
> Set xlApp = CreateObject("Excel.Application") Set xlWb =
> xlApp.Workbooks.Open("C:\Report.xls")
> ' make some changes here to the file ...
> xlWb.Save
> Since the file already exist and I am making changes to it, the 'Save'
> command will trigger a prompt and I have to answer 'yes' to the Excel
> question 'File already exists. Do you want to replace this file?'
> Does the Save command or another command accept a parameter so it will
> overwrite the file without the prompt?
>
> THANKS!!
>
>|||Yes, we understand why it is doing it, but the question is: how can we get
around this problem. We just wanted to automatically over-write the file.
Any clues?
"jongwoo" <jongwoo@.discussions.microsoft.com> wrote in message
news:EFE9CE78-0B81-4A79-8669-F6B6B605F7B1@.microsoft.com...[vbcol=seagreen]
> it does not overwrite the file without the prompt.
> Because It occur security web browser.
> cheers...
> "Dean J Garrett" wrote:
>|||Yes, we understand why it is doing it, but the question is: how can we get
around this problem. We just wanted to automatically over-write the file.
Any clues?
"jongwoo" <jongwoo@.discussions.microsoft.com> wrote in message
news:EFE9CE78-0B81-4A79-8669-F6B6B605F7B1@.microsoft.com...[vbcol=seagreen]
> it does not overwrite the file without the prompt.
> Because It occur security web browser.
> cheers...
> "Dean J Garrett" wrote:
>
ActiveX from SQL?
I'm trying to use ActiveX from SQL to save an Excel file. I use the
following code:
Set xlApp = CreateObject("Excel.Application") Set xlWb = xlApp.Workbooks.Open("C:\Report.xls")
' make some changes here to the file ...
xlWb.Save
Since the file already exist and I am making changes to it, the 'Save'
command will trigger a prompt and I have to answer 'yes' to the Excel
question 'File already exists. Do you want to replace this file?'
Does the Save command or another command accept a parameter so it will
overwrite the file without the prompt?
THANKS!!it does not overwrite the file without the prompt.
Because It occur security web browser.
cheers...
"Dean J Garrett" wrote:
> Hello,
>
> I'm trying to use ActiveX from SQL to save an Excel file. I use the
> following code:
> Set xlApp = CreateObject("Excel.Application") Set xlWb => xlApp.Workbooks.Open("C:\Report.xls")
> ' make some changes here to the file ...
> xlWb.Save
> Since the file already exist and I am making changes to it, the 'Save'
> command will trigger a prompt and I have to answer 'yes' to the Excel
> question 'File already exists. Do you want to replace this file?'
> Does the Save command or another command accept a parameter so it will
> overwrite the file without the prompt?
>
> THANKS!!
>
>|||Yes, we understand why it is doing it, but the question is: how can we get
around this problem. We just wanted to automatically over-write the file.
Any clues?
"jongwoo" <jongwoo@.discussions.microsoft.com> wrote in message
news:EFE9CE78-0B81-4A79-8669-F6B6B605F7B1@.microsoft.com...
> it does not overwrite the file without the prompt.
> Because It occur security web browser.
> cheers...
> "Dean J Garrett" wrote:
>> Hello,
>>
>> I'm trying to use ActiveX from SQL to save an Excel file. I use the
>> following code:
>> Set xlApp = CreateObject("Excel.Application") Set xlWb =>> xlApp.Workbooks.Open("C:\Report.xls")
>> ' make some changes here to the file ...
>> xlWb.Save
>> Since the file already exist and I am making changes to it, the 'Save'
>> command will trigger a prompt and I have to answer 'yes' to the Excel
>> question 'File already exists. Do you want to replace this file?'
>> Does the Save command or another command accept a parameter so it will
>> overwrite the file without the prompt?
>>
>> THANKS!!
>>
ActiveX
In VB Dir$ function could have been used, what should I use in ActiveX?
Thanks a lot for your helpI'm not sure how to rename the file but you might be able to use the xp_fileexist extended proc to see if the file is in the directory.|||This is a start:
Function Main()
Dim objFSO
Dim objFolder
Dim objFile
Dim fileName
Dim folderName
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("\\server\share$\dir\")
folderName = "\\server\share$\dir\Archive\" & Month(Now) & Day(Now) & Year(Now) & "_" & Hour(Now) & Minute(Now) & Second(Now) & "\"
For Each objFile in objFolder.Files
objFSO.CreateFolder(folderName)
fileName = objFile.Path
objFSO.MoveFile fileName, folderName
Next
Main = DTSTaskExecResult_Success
End Function|||Now I'm getting what I need to do, thanks a lot for your help.sql
Tuesday, March 20, 2012
active x script task error
Hi,
I am working with an active x script task and I keep getting this error.
[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x01DF3DD4.
I have tried to delete all but the first couple of lines but I keep getting this error. Does anyone have any ideas on how I can fix this. This code worked fine in SQL Server 2000.
Thanks
Brian
This is a snippet of my code
Function Main()
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004
set mySourceConn = CreateObject("ADODB.Connection")
set rstemp = CreateObject("ADODB.Recordset")
set newtbltemp = CreateObject("ADODB.Recordset")
Main = DTSTaskExecResult_Success
End Function
active x script task error
Hi,
I am working with an active x script task and I keep getting this error.
[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x01DF3DD4.
I have tried to delete all but the first couple of lines but I keep getting this error. Does anyone have any ideas on how I can fix this. This code worked fine in SQL Server 2000.
Thanks
Brian
This is a snippet of my code
Function Main()
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004
set mySourceConn = CreateObject("ADODB.Connection")
set rstemp = CreateObject("ADODB.Recordset")
set newtbltemp = CreateObject("ADODB.Recordset")
Main = DTSTaskExecResult_Success
End Function
Active X script help in a DTS package
The xx is the fiscal week meaning the file one week looks like achcons18.dat and the next week it will look like achcons19.dat
I am trying use an ActiveX script in my DTS package to unzip that file and rename to achcons.dat so I can import.
My code looks like this so far:
Function Main()
Dim objWshshell, objFso
Dim strCmd, strSubject, strMessage, strFileattachment, rc
DTSGlobalVariables("gv_strWklydir").value = "\\E$\Update\Data\" ' Weekly directory
DTSGlobalVariables("gv_strACHFile").value = "achcons" & DTSGlobalVariables("gv_strFW").value & ".zip" ' ACH Group weekly file
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objWshshell = CreateObject("WScript.Shell")
rc = 0
' Build the Winzip command
If (objFso.FileExists(DTSGlobalVariables("gv_strWklydir").value & DTSGlobalVariables("gv_strACHFile").value)) Then
strCmd = "winzip32.exe -e -o " & DTSGlobalVariables("gv_strWklydir").value &_
DTSGlobalVariables("gv_strACHFile") & " " & DTSGlobalVariables("gv_strWklydir").value
rc = objWshshell.Run(strCmd, 1, true)
If (objFso.FileExists(DTSGlobalVariables("gv_strWklydir").value & objFso.GetBaseName(DTSGlobalVariables("gv_strACHFile")) & ".dat")) Then
objFso.GetFile(DTSGlobalVariables("gv_strWklydir").value & objFso.GetBaseName(DTSGlobalVariables("gv_strACHFile")) & ".dat").Copy (DTSGlobalVariables("gv_strWklydir").value & "achcons.dat")
End If
Set objWshshell = Nothing
Set objFso = Nothing
End If
I also have an e-mail routine that sends me an e-mail if the file doesn't exist. The e-mail works so my code can't see the file it needs to unzip and rename.
Any help is appreciated.May refer to http://www.sqldts.com for any reference on activex using in DTS.
Thursday, March 8, 2012
Actach database file without log file?
Hi, im trying to set up a database where i have the mdf and log file. The
original server was taken offline in a power failure and the server didnt
start again. Im setting upp a new server and copied the mdf and ldf file,
but when i tired to attach in different methodes with or without the ldf
file it didnt work. Is there any way to fix and attach a corrupt mdf or ldf
file? I have some backup files to .bak and trn. The bak file is from 31 july
and the trn file is from 27 and 28. But when i try to take a backup its
saying something about a consisstity check. I will get the error message
later, but is there som way to fix and attach the original mdf and/or ldf
file'
/Per W.Hi Per,
I am not sure if you have tried sp_attach_single_file_db yet, but if you
have tried that and it doesn't work, I suggest you to call Microsoft
Product Support Service for help.
Sincerely,
Yih-Yoon Lee [Microsoft]
Microsoft SQL Server Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.|||"Yih-Yoon Lee [MS]" <yihyoonl@.online.microsoft.com> skrev i melding
news:JD9DkbmYDHA.2520@.cpmsftngxa06.phx.gbl...
> Hi Per,
> I am not sure if you have tried sp_attach_single_file_db yet, but if you
> have tried that and it doesn't work, I suggest you to call Microsoft
> Product Support Service for help.
>
I have tried it. When i use that command with the .mdf the error message is
that it cant find the logfile. And the directory thats 'missing' is in a
place that dont exist on the new server, i have tried to setup a disk with
correct driveletter and directory structure, but it still not working either
with attach_database or attach_single_file. I have tried with the log file
in correct place and also tried to remove the logfile. I have also tried to
use the backup file. The maintance plane is buliding up some field cald .bak
and .trn When i select the .bak file and goes in to the 'view contents' its
displayd 'incomplete' Why? the maintance plane is configured to hold on the
files in 1 week. But the .trn file is not the same date as the .bak file.
But if i also select the .trn file togheter with the .bak file its still
'incomplete'. i normaly use Veritas Backup Exec to do backup off sql
databases, and has never had problem restoring from that program, but this
customer dont have that program. Isnt the backup rutine in the SQL Manager
'good'.
/Per W.|||Hi,
I think your database is not shutdown clean. In this case, you cannot use
sp_attach_single_file_db to attach.
Is the backup file on the same system with SQL Server? It does sound like
the backup file is corrupted as well.
Sincerely,
Yih-Yoon Lee [Microsoft]
Microsoft SQL Server Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.|||"Yih-Yoon Lee [MS]" <yihyoonl@.online.microsoft.com> skrev i melding
news:qarjuEoYDHA.2020@.cpmsftngxa06.phx.gbl...
> Hi,
> I think your database is not shutdown clean. In this case, you cannot use
> sp_attach_single_file_db to attach.
> Is the backup file on the same system with SQL Server? It does sound like
> the backup file is corrupted as well.
>
Yes, it is one the same system. The volume was a RADI5 diskset with 3 disks
that didnt power up after a power failure. Two of the disks and the RAID
controller was defect and IBAS (a firm in Norway that rescue data) extractet
the data on the remaining out off the disks. All other documents and files
are correct, but all databse files is in this mystic condition. Ther is 5
diffrent databases and everyone has the same problem. None off the
backupfile of the SQL is function either, but when all documents and e-mail
and other database program, economics program that dont use SQL is correct,
shoudnt at least 1 or 2 database files or backup files also be correct?
There is some undocumentet commands that can be used to extract data from
coruptet mdf files, does anyone has some descripton of this command?
/Per W.|||There is no such undocumented command. There are some companies out there
that can perform some kind of disaster recovery and read data from corrupt
files, but I am not sure how well that works.
Sincerely,
Yih-Yoon Lee [Microsoft]
Microsoft SQL Server Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
Tuesday, March 6, 2012
ACH FILE ORIGINATION RIGHT FROM SQLServer
Hi,
we are trying to develop ach origination (bank direct debits and deposits) right from sqlserver without using ach software...our mgmt team rightly points out "...why use a separate software that you'll have to transfer your data into when sqlserver has all the capabilities to build the files and create tramsmittable, formatted messages.
Does anyone know of any examples...like best practices for setting up the headers (file header, batch header, etc) for multiple re-use...or any sample execs for creating the files on the fly? -- we're experimenting with our own functions for this and will share what we create, but any examples from anyone who has been working on something similar would be great to look at.
Thx much,
Haven't done ACH, but I've created stored procedures to generate some batch files for mainframe consumption before (2 columns per row), one is record id, one is data. Built up a temp table like that, then selected out of the temp table ordered by record id. I wouldn't say it's the greatest solution in the world, but it worked.
SQL Server really is the back end database. It's for storing a retrieving data. The application is (SHOULD) responsible for presenting (formatting) that data into whatever you want. You can use T-SQL (Or I guess the built-in .NET stuff now) to pre-format the data, but I would argue that mixes the data and presentation layers which is against good design practices. Others may argue that the tables, etc are the data layer, and the stored procedures are acting as the presentation layer.
acess I/O File
with transact-sql?.
I've create a stored procedure and I'd like to write in a log file
some traces depends on the result of the statements executed in this
stored procedure.
ThanksHere's one method:
ALTER PROC WriteToLog
@.Message varchar(100)
AS
DECLARE @.Command varchar(255)
BEGIN TRAN
-- ensure only one process writes to the log at a time
EXEC sp_getapplock
@.Resource = 'MyLog.txt',
@.lockmode = 'Exclusive'
SET @.Command = 'ECHO ' +
@.Message +
' >>"C:\MyLog.txt"'
EXEC master..xp_cmdshell @.Command, NO_OUTPUT
EXEC sp_releaseapplock @.Resource = 'MyLog.txt'
COMMIT
GO
EXEC WriteToLog 'Test message'
--
Hope this helps.
Dan Guzman
SQL Server MVP
--------
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index...epartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--------
"Bego?a" <bego_colomer@.yahoo.es> wrote in message
news:c04c2a85.0311180409.4631ec98@.posting.google.c om...
> Is it possible to access a file (for example, to write in a text file)
> with transact-sql?.
> I've create a stored procedure and I'd like to write in a log file
> some traces depends on the result of the statements executed in this
> stored procedure.
> Thanks
Friday, February 24, 2012
Accessing URL
Hi!
I have two assets: a URL that points to an XML file, and a stored procedure that can accept this file as a text variable and store it in a SQL 2005 table.
create procedure [dbo].[insertObjects]
@.availabilityXml text
as
DECLARE @.xmlHndAdd INT
EXEC sp_xml_prepareDocument @.xmlHndAdd OUTPUT, @.availabilityXml
TRUNCATE TABLE Objects
INSERTObjects
SELECT *
FROM OPENXML(@.xmlHndAdd, '//NewDataSet/Table1', 2)
WITH Objects
Now, I need to find a solution to combine the URL with the proc.Does anyone have any suggestions on how I can pass my URL as a text variable to the procedure?SSIS, vb-script, etc. are welcome!
Thank you!
I believe these are your choices:
a) Store the data into a table through the URL and read it, this approach is mentioned here ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/dff99404-a002-48ee-910e-f37f013d946d.htm (Bulk Importing and Exporting XML Documents) in the SQL Server BOL.
b) Use OPENXML for loading data into a variable. This approach is given here: http://www.perfectxml.com/articles/xml/importxmlsql.asp#openxml
Hope this helps.
Thanks
Waseem
|||Thanks for the reply! I used the a approach, and it's working!|||Which approach did you use?|||OPENXML (b)
Accessing URL
Hi!
I have two assets: a URL that points to an XML file, and a stored procedure that can accept this file as a text variable and store it in a SQL 2005 table.
create procedure [dbo].[insertObjects]
@.availabilityXml text
as
DECLARE @.xmlHndAdd INT
EXEC sp_xml_prepareDocument @.xmlHndAdd OUTPUT, @.availabilityXml
TRUNCATE TABLE Objects
INSERTObjects
SELECT *
FROM OPENXML(@.xmlHndAdd, '//NewDataSet/Table1', 2)
WITH Objects
Now, I need to find a solution to combine the URL with the proc.Does anyone have any suggestions on how I can pass my URL as a text variable to the procedure?SSIS, vb-script, etc. are welcome!
Thank you!
I believe these are your choices:
a) Store the data into a table through the URL and read it, this approach is mentioned here ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/dff99404-a002-48ee-910e-f37f013d946d.htm (Bulk Importing and Exporting XML Documents) in the SQL Server BOL.
b) Use OPENXML for loading data into a variable. This approach is given here: http://www.perfectxml.com/articles/xml/importxmlsql.asp#openxml
Hope this helps.
Thanks
Waseem
|||Thanks for the reply! I used the a approach, and it's working!|||Which approach did you use?|||OPENXML (b)
Accessing URL
Hi!
I have two assets: a URL that points to an XML file, and a stored procedure that can accept this file as a text variable and store it in a SQL 2005 table.
create procedure [dbo].[insertObjects]
@.availabilityXml text
as
DECLARE @.xmlHndAdd INT
EXEC sp_xml_prepareDocument @.xmlHndAdd OUTPUT, @.availabilityXml
TRUNCATE TABLE Objects
INSERTObjects
SELECT *
FROM OPENXML(@.xmlHndAdd, '//NewDataSet/Table1', 2)
WITH Objects
Now, I need to find a solution to combine the URL with the proc.Does anyone have any suggestions on how I can pass my URL as a text variable to the procedure?SSIS, vb-script, etc. are welcome!
Thank you!
I believe these are your choices:
a) Store the data into a table through the URL and read it, this approach is mentioned here ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/dff99404-a002-48ee-910e-f37f013d946d.htm (Bulk Importing and Exporting XML Documents) in the SQL Server BOL.
b) Use OPENXML for loading data into a variable. This approach is given here: http://www.perfectxml.com/articles/xml/importxmlsql.asp#openxml
Hope this helps.
Thanks
Waseem
|||Thanks for the reply! I used the a approach, and it's working!|||Which approach did you use?|||OPENXML (b)
Accessing the underlying sql query from the rdl file
Our client uses the report builder to generate reports for collection of employees. We would like to use the employee records in this report to perform some additional processing (such as the list of employees gets assigned to a particular group).
Programmatically, I can retrieve a byte stream from rs.GetReportDefinition( "\myClientEmpReport") and deserialize the stream into Report object (as define by ReportDefinition.xsd).
I can then manually drill down and retrieve the SematicQuery xml from the commandText field.
The problem is how to convert the SemanticQuery format into a T-Sql query that I can run against the view that the report model is based off of.
Is this possible?
Thanks,
Arjay
P.S. Running SQL 2005 Reporting Services, VC# 2005, ASP.Net 2.0.
After attempting to autogenerate serialization classes on the SemanticQuery xml with Xsd and XsdObjectGen, I ended up hand coding some classes that handled recursion. From there, I was able to regenerate the sql query by walking through the filter and grouping sections. While this isn't a generic solution, it works well for my needs because the model I need this for is a single datasource derived from a view.
As a feature request, it sure would be nice to be able get the query string from the reporting engine directly.
Sunday, February 19, 2012
Accessing the Log File Physical File Name and Path
I am new to SMO and VB.NET and I need to access the transaction log's physical file name and path so that I can correctly relocate it when it is restored on a different.
What I would like to do is display the database and log's physical file and path names in some type of data control for selection by a user during a restore operation.
I have been able to do this for the database but can't seem to get it to work for the log file. How do I find the log file's physical file name and path using SMO? I can't seem to be able to relate the logfile collection and class to specific databases.
Thanks for your help!
Database.LogFiles property gives you a collection of LogFile object, each of which represents a log file on the database. You can access the location and name of the log file using LogFile.FileName and LogFile.Name properties respectively. Refer BOL for more details.
Thanks,
Kuntal
Accessing the FileSystem
table of mine. In this table there is a filename to a file on my server. I
want to make sure that the filename actually points to a file on the server.
In other words I want to make sure the file exists!
Thanks in advancetry this
exec master..xp_fileexist 'C:\Program Files\Microsoft SQL
Server\MSSQL\readme.txt'
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||Also try OLE Automation stored procedures.
Search for "OLE automation, FolderExists, copy, etc from stored
procedure" in this newsgroup. Date Posted: 4/26/2006 11:08:00 PM.
*** Sent via Developersdex http://www.examnotes.net ***
Thursday, February 16, 2012
accessing SQL Server Compact Edition from VBA
Is it possible to connect to SQL Server Compact Edition with Visual Basic for Application?
I want to connect to *.sdf file from MS Access.
I suppose you can do it using OLEDB if VBA allows you to use COM objects (which you should know better as I've never used VBA).
|||Thanks. I also suspected that, just was not sure is there OLEDB provider version for desktops, and how to access it. Just foud that information in one of the mahdi posts
Dim cnx As ADODB.Connection
Set cnx = New ADODB.Connection
cnx.ConnectionString = "Provider='Microsoft.SQLSERVER.MOBILE.OLEDB.3.0.';Data Source='c:\\B.sdf';"
cnx.Open
Thursday, February 9, 2012
Accessing MSDE 2000
a sa password.
[Options]
SAPWD="cfm56z"
Setup appears to run and install msde. However when I try to access it with
DbatMGR, I get
SQL Server does not exist or access is denied
Any suggestions would be helpful.
Thanks,
Fred Herring
hi Fred,
Fred Herring wrote:
> Setup appears to run and install msde. However when I try to access
> it with DbatMGR, I get
> SQL Server does not exist or access is denied
>
this kind of error is a general exception raised by MDAC... please check
http://support.microsoft.com/default...06&Product=sql
for more info on how to troubleshoot it
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.11.1 - DbaMgr ver 0.57.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply