Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: DoCmd.TransferSpreadsheet - Access can't find my query

Geek News

DoCmd.TransferSpreadsheet - Access can't find my query
"bifteki via AccessMonster.com" <u16204[ at ]uwe> 11/13/2008 2:24:07 PM
I have the following line in my code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"sp_export_persons_to_excel", "W:\DOCS\DRAFTS\eortazontes.xls", True, "A1:
G12"

sp_export_persons_to_excel is a stored procedure.
However Access tells me that it "can't find the object
'sp_export_persons_to_excel' ".
I tried replacing the string "sp_export_persons_to_excel" with the names of
other queries in my DB, but I get the same message.

Does anyone know why this may occur?

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200811/1

Re: DoCmd.TransferSpreadsheet - Access can't find my query
"Klatuu" <david.hargis[ at ]realpage.com> 11/13/2008 9:12:29 PM
When you say stored procedure, I am thinking SQL Server. There are no
stored procedures in Access.
The TransferSpreadsheet will not find an objects in SQL Server, it has to be
an Access Query in your database.

"bifteki via AccessMonster.com" <u16204[ at ]uwe> wrote in message
news:8d215b05637d9[ at ]uwe...
[Quoted Text]
>I have the following line in my code:
>
> DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
> "sp_export_persons_to_excel", "W:\DOCS\DRAFTS\eortazontes.xls", True, "A1:
> G12"
>
> sp_export_persons_to_excel is a stored procedure.
> However Access tells me that it "can't find the object
> 'sp_export_persons_to_excel' ".
> I tried replacing the string "sp_export_persons_to_excel" with the names
> of
> other queries in my DB, but I get the same message.
>
> Does anyone know why this may occur?
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200811/1
>


Re: DoCmd.TransferSpreadsheet - Access can't find my query
"bifteki via AccessMonster.com" <u16204[ at ]uwe> 11/14/2008 1:12:59 PM
Hmm... Maybe I'm getting something wrong.
In Access (at least 2003 & 2007 which I'm using) you have the option to
create either a view, stored procedure, or function.
I made this stored procedure in access. I also tried creating it as a view
but Access still can't find the object.


Klatuu wrote:
[Quoted Text]
>When you say stored procedure, I am thinking SQL Server. There are no
>stored procedures in Access.
>The TransferSpreadsheet will not find an objects in SQL Server, it has to be
>an Access Query in your database.
>
>>I have the following line in my code:
>>
>[quoted text clipped - 10 lines]
>>
>> Does anyone know why this may occur?

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200811/1

Re: DoCmd.TransferSpreadsheet - Access can't find my query
"Klatuu" <david.hargis[ at ]realpage.com> 11/14/2008 3:42:59 PM
If you are using an ADP connected to an SQL Server back end, you can, but
you did not state that.

"bifteki via AccessMonster.com" <u16204[ at ]uwe> wrote in message
news:8d2d4e9ec8fc6[ at ]uwe...
[Quoted Text]
> Hmm... Maybe I'm getting something wrong.
> In Access (at least 2003 & 2007 which I'm using) you have the option to
> create either a view, stored procedure, or function.
> I made this stored procedure in access. I also tried creating it as a view
> but Access still can't find the object.
>
>
> Klatuu wrote:
>>When you say stored procedure, I am thinking SQL Server. There are no
>>stored procedures in Access.
>>The TransferSpreadsheet will not find an objects in SQL Server, it has to
>>be
>>an Access Query in your database.
>>
>>>I have the following line in my code:
>>>
>>[quoted text clipped - 10 lines]
>>>
>>> Does anyone know why this may occur?
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200811/1
>


Re: DoCmd.TransferSpreadsheet - Access can't find my query
"bifteki via AccessMonster.com" <u16204[ at ]uwe> 11/18/2008 11:36:51 AM
I guess you are right. I didn't think of that.
The DB is indeed on SQL server.
So this means I cannot use TransferSpreadsheet at all?


Klatuu wrote:
[Quoted Text]
>If you are using an ADP connected to an SQL Server back end, you can, but
>you did not state that.
>
>> Hmm... Maybe I'm getting something wrong.
>> In Access (at least 2003 & 2007 which I'm using) you have the option to
>[quoted text clipped - 13 lines]
>>>>
>>>> Does anyone know why this may occur?

--
Message posted via http://www.accessmonster.com

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net