Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Wednesday, March 28, 2012

Problem with BCP

Hi,
I execute this command in CMD:
bcp pubs..authors out c:\test.dat -T -n
I get the following error:
Code page 720 is not supported by SQL Server.
Unable to resolve column level collation.
I'm using Personal Edition on Win XP Prof. I have not modified anything in
pubs database.
Any help would be greatly appreciated.
LeilaHi
You may want to try the -C option to specify 720 or RAW. Alternatively a
format file specifying the collation may work.
http://msdn.microsoft.com/library/d...>
bcp_1y43.asp
John
"Leila" <leilas@.hotpop.com> wrote in message
news:eUUw97aTFHA.2172@.tk2msftngp13.phx.gbl...
> Hi,
> I execute this command in CMD:
> bcp pubs..authors out c:\test.dat -T -n
> I get the following error:
> Code page 720 is not supported by SQL Server.
> Unable to resolve column level collation.
> I'm using Personal Edition on Win XP Prof. I have not modified anything in
> pubs database.
> Any help would be greatly appreciated.
> Leila
>
>|||Thanks John!
RAW worked :-)
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:#gQu8whTFHA.3620@.TK2MSFTNGP09.phx.gbl...
> Hi
> You may want to try the -C option to specify 720 or RAW. Alternatively a
> format file specifying the collation may work.
>
http://msdn.microsoft.com/library/d...-us/adminsql/ad
_impt_bcp_1y43.asp
> John
> "Leila" <leilas@.hotpop.com> wrote in message
> news:eUUw97aTFHA.2172@.tk2msftngp13.phx.gbl...
in
>

Monday, March 26, 2012

Problem with asp page and ODBC on Windows 2003 SR 64 Bits

I have an Application developed on ASP, I got a few new servers 64bits, I installed microsoft WIN 2003 SR.
When I get in into the web site I receive this errors:

Microsoft OLE DB Provider for ODBC Driverserror '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/ConnectToDatabase.asp, line 17

I made some obvios checks, I checked that the ODBC really exists and we move the IIS 6.0 to run in 32bits mode as I found in some page.

Thanks you.

Ahmed

Hi,

could you please post your connection string right in here ? We can′t see if you use a DSN or a DSNless connection.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

You are likely using an ODBC driver that is not available for 64bits. See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=20574&SiteID=1 for the relevnat discusion.

Can you connect to the odbc driver in question using ODBC driver manager. Start->Run->ODBCAD32.exe. Using odbc driver manager create a new dsn and test the connection.

Problem with asp page and ODBC on Windows 2003 SR 64 Bits

I have an Application developed on ASP, I got a few new servers 64bits, I installed microsoft WIN 2003 SR.
When I get in into the web site I receive this errors:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/ConnectToDatabase.asp, line 17

I made some obvios checks, I checked that the ODBC really exists and we move the IIS 6.0 to run in 32bits mode as I found in some page.

Thanks you.

Ahmed

Hi,

could you please post your connection string right in here ? We can′t see if you use a DSN or a DSNless connection.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

You are likely using an ODBC driver that is not available for 64bits. See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=20574&SiteID=1 for the relevnat discusion.

Can you connect to the odbc driver in question using ODBC driver manager. Start->Run->ODBCAD32.exe. Using odbc driver manager create a new dsn and test the connection.

Wednesday, March 21, 2012

problem with a date parameter in ASP.Net page

The date format in the 'weekending' textbox is 5/5/2007
Here's what I've got:

With cmd.Parameters
.Add(New SqlParameter("@.SQLweekending", SqlDbType.DateTime,weekending.Text))
the error message is:
"Conversion from string "4/8/2007" to type 'Integer' is not valid."

Then, I tried:
.Add(

New SqlParameter("@.SQLweekending", SqlDbType.DateTime,CDate(weekending.Text)))

but, before I even tried it, it gave me a blue squiggly line, with an error message:
"Error 2 Value of type 'Date' cannot be converted to 'Integer'"

How can I get this to work?

Hi,

What is the data type for yourSQLweekending column in your table? Is it a DateTime column or Integer type? You need a DateTime column for this.

|||Nope - it's datetime also|||

Here is sample in VB.NET that inserts date to a datetime column:

Dim MySQLAsString ="Insert into Dates (id, tDate) values (@.id, @.tDate)"Dim myConnAs SqlConnection =New SqlConnection(ConfigurationManager.ConnectionStrings("forumConnectionString").ConnectionString.ToString())Dim CmdAsNew SQLCommand(MySQL, MyConn)

Cmd.Parameters.Add(

New SqlParameter("@.id", txtid.Text))

Cmd.Parameters.Add(

New SqlParameter("@.tDate",txttDate.Text))

MyConn.Open()

cmd.ExecuteNonQuery()

MyConn.Close()sql

Monday, March 12, 2012

Problem When using Recordset paging

Hi, guys,

I got a problem when trying to paging the recordset. the problem is
even I set the pagesize but the first page will always show all the
records and the number of records that shown on the second page will
always all records number minus pagesize. for example, if I have total
5 records and pagesize = 2, then first page will show 5 record and
second one will show 3 and the last page will show the last one.

any one have some idea about that condition?

Thanks a lot!Li (zlusc@.hotmail.com) writes:
> I got a problem when trying to paging the recordset. the problem is
> even I set the pagesize but the first page will always show all the
> records and the number of records that shown on the second page will
> always all records number minus pagesize. for example, if I have total
> 5 records and pagesize = 2, then first page will show 5 record and
> second one will show 3 and the last page will show the last one.
> any one have some idea about that condition?

I guess you are using paging in ADO, but there are so many ways to do
paging, that rather I would like to know. Maybe you have some code to
share?

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Saturday, February 25, 2012

Problem using parameter on SQL source data control

I have an ASP page which uses an SQL data source control, as shown below:

<asp:SqlDataSource ID="mySQL" runat="server"
ConnectionString="<%$ ConnectionStrings:mySQLConnectionString %>"
SelectCommand="SELECT device FROM device_table WHERE (device_id IN (@.devicelist))">
<SelectParameters>
<asp:Parameter DefaultValue="" Name="devicelist" Type="String" />
</SelectParameters>
</asp:SqlDataSource
The problem is getting the "IN" clause of the select statement to work via the ASP page with code behind in C#. If I test the query in the page designer when configuring the SQL control by inserting 'device-1','device-2','device-3' as the value for the "devicelist" parameter, everything works as expected. However, when that same value is written programmatically into the DefaultValue of the parameter, the resulting query contains no results (as if the string contents are invalid). If I alter my program to supply a single entry (with no commas) it seems to work as well. I suspect the comma (and possibly the single-quote) characters in my string when multiple entries are involved are causing the issue.

Is there a proper technique for getting the requisite quote-delimited, comma-separated list into the SQL control command parameter correctly? Should I be using some sort of escape sequence for the single-quote and comma characters? Should I be using another "type" for the parameter; one that accepts an array of entries? I have not been able to find any examples or documentation that provides an answer.

A slight adjustment to the statements made in my earlier post: Using the "Test query" in the page design view for the control does NOT work. What does work is using SQL Server 2005 to run an equivalent query. So the page design view test query functionality and the ASP page functionality do indeed match, unlike what I stated earlier. I apologize for any confusion this may have caused.

But the problem still remains: how can I get the list of values passed into the control via the parameter?