Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Error in executing asp+mssql

Author  Topic 

diana13
Starting Member

6 Posts

Posted - 2007-02-09 : 05:08:15
Hello,

I hope this forum is suitable for posting my question.

I have a site in asp and vb with an access database. It's work just fine. I want to convert my database from access to mssql express. So I convert it with Microsoft SQL Server Migration Assistant for Access. I also install mssql server on my computer, so I can test my site at home.
But now, I have trouble, I've received many errors like:

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#'.
(this appear when I try to insert date and time in database, witch in access database I have no problem)

ODBC driver does not support the requested properties
(this appears when I make a selection in database, where I use inner join).

And many more ...

Do I have to rewrite the code to all my files? It's so different working with MSSQL comparing with Access database?

From what I read, I understand that after converting the database from Access to MSSQL, I must change only the connection string and the site have no problem. But it seems it's not so easy. I'm pretty disappointed.

Can you give me an advice? Or some links where I can read something that can help me.

Thanks.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-09 : 05:11:28
Dates are not enclosed with # in MS SQL Server. Replace # with single quote ' instead.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

diana13
Starting Member

6 Posts

Posted - 2007-02-09 : 05:52:50
Thanks,Peso.

The second errors from my first post occurs when I made a selection like this:

"SELECT * from (SELECT * from Table_1 inner join Table_2 on Table_1.col1=Table_2.col1) Z inner join Table_3 on Z.col2=Table_3.col2 where Table_1.col4=1 order by Table_1.add_date desc"
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-09 : 05:56:45
[code]SELECT *
from Table_1 inner join Table_2 on Table_1.col1=Table_2.col1
inner join Table_3 on Z Table.col2=Table_3.col2
where Table_1.col4=1
order by Table_1.add_date desc
[/code]

Table: replace this with either table_1 or table_2 depending on where col2 belongs.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

diana13
Starting Member

6 Posts

Posted - 2007-02-09 : 06:18:20
Thanks, it really works.
Go to Top of Page
   

- Advertisement -