|
Paste ur code here and we will solve problem
|
|
|
|
|
Hi,
I need to modify a MS Access database:
- Rename tables
- Rename columns
- Add new columns and set field properties
(Can't seem to set "Allow Zero Length" with Access SQL)
I'm finding that SQL for Access is sometimes lacking when I need to update the database as my application grows. I see from my on-line research that some people turn to DAO or ADOX. If I'm working with an Access db, which should I use and why?
PS - Why would MS Access have a field property "Allow Zero Length" but no SQL statement to set/change it?
thanks,
Ron
|
|
|
|
|
First of all, only Text, Memo and Hyperlink fields can accept zero length strings and therefore have that property.
You may want to look into using DDL to manage your table properties.
Steve
|
|
|
|
|
Thanks Steve,
I knew that only Text, Memo and Hyperlink fields only have that property, but as far as my research, I can't use SQL to change this property... if there is, please let me know.
Thanks for the tip on DDL, I'll do some research.
Ron
|
|
|
|
|
I always do such edits in Access. I have never tried to alter table structures dynamically from VB.
You may want to try posting your question in MDBMakers.com.
This forum has Access MVP's and many knowledgeable users who may be able to help you.
Steve
|
|
|
|
|
hi,
i'm working on mysql database i want to select from table last 10 rows inserted where id=5
Always Thx for you help
Regards,
Charbel Asmar
|
|
|
|
|
SELECT * from mytable where id=5 order by orderbyfield <code>LIMIT 10</code>
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I'm using VC++ 6.0, and using the ODBC API to connect to the databse.
My question is that is there a way to find the limit of the number of fields permitted per Primary Key.
Eg. For MS SQL 2000/ 2005 limit is 16 or less fields for a primary key.
For MS Access the limit is 10 or less fields for a primary key.
|
|
|
|
|
Try SQLGetInfo(SQL_MAX_COLUMNS_IN_INDEX).
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi guys;
I have this problem with sql server 2000 and asp.net 2.0
Here is the problem:
I am trying to use the Roles.AddUserToRole(string username ,string Role) .
Now the problem starts when the program gets to this place where it has to execute the addusertorole method. Im getting this error:
Error 446: cannot resolve collation conflict for equal to operation
I have read alot and searched the internet but I dont quit get what am I suppose to do.
Could you please help me to resolve this problem?
Thanks a million
Hadi
|
|
|
|
|
Hi ;
Thanks alot for the reply from minhpc_bk was very usefull. Right on time.
Here is how i fixed the problem:
I replaced the line in aspnet_UsersInRoles_AddUsersToRoles stored procedure
DECLARE @tbNames table(Name nvarchar(256) NOT NULL PRIMARY KEY)
with
DECLARE @tbNames table(Name nvarchar(256) COLLATE Database_Default NOT NULL PRIMARY KEY)
Riazi
|
|
|
|
|
Hi,
In SQL Server Everywhere, there is no support for keyword "TOP" for selecting
limited number of rows. Can you give me any idea how can I perform similar task with this limitation ?
Thanks in advance
|
|
|
|
|
Hi;
If I understood your problem your trying to select a limited number of rows of your table?
What version of SQL SERVER are you using? If your using 2000 then the TOP keyword should work fine.
SELECT TOP 7 FROM LatestNews
Im using it with out problems.
Riazi
|
|
|
|
|
Hi Riazi,
Thanks for your support.
I am using SQL SERVER EVERYWHERE 2005, which is a latest mobile and desktop database solution from Microsoft released very recently in this year. This is actually SQL Server Mobile upgraded version. And this SQL Server Everywhere doesnot support TOP and ROWCOUNT keyword. So, I thought there might be some tehcnique to perform this similar task.
SQL SERVER EVERYWHERE 2005 : Web link[^]
Thanks and regards.
|
|
|
|
|
Does this work?
Set ROWCOUNT @aNumber
Farhan Noor Qureshi
|
|
|
|
|
Hi Farhan,
Thanks for your support.
I am using SQL SERVER EVERYWHERE 2005, which is a latest mobile and desktop database solution from Microsoft released very recently in this year. This is actually SQL Server Mobile upgraded version. And this SQL Server Everywhere doesnot support TOP and ROWCOUNT keyword. So, I thought there might be some tehcnique to perform this similar task.
Thanks and regards.
|
|
|
|
|
As with all computer technology there are usually many ways to perform one task.
At our shop we're new at the whole SQL database process. On our old apps with our mainframe we have test databases, we make changes and then copy the framework of the test database into production.
With SQL we have two servers. A development server and a production server. What is the best way to move a database from our development server with select tables and select stored procedures.
Does the backup / restore process lend itself to this kind of move or should we be researching into DTS?
I'm looking for suggestions from those of you who have worked with SQL databases for years and can guide newbies to the best solution you've found.
Any suggestions are welcome
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: What is the best way to move a database from our development server with select tables and select stored procedures.
One way would be to have sql scripts that create new tables / stored procedures and update altered tables / stored procedures. Run these scripts on the production server after you've tested on the development server.
I am sure there are other ways, but this is the first to come to my mind
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
Using the enterprise manager you could choose the copy database item from the context menu. This could be used to copy the database and create a script to be run for later updates.
only two letters away from being an asset
|
|
|
|
|
Cool!!
That seems way to simple, but I tested it and it works great!!
Are there any drawbacks? Is it accurate creating the scripts or are there disadvantages to this method??
Thanks for your idea!!
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: Is it accurate creating the scripts or are there disadvantages to this method??
Use scripts unless you want to update any changes by hand.
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
I would rather use scripts than doing the work by hand. I just don't always trust Microsoft, so it always helps to ask if there are any drawbacks to using the scripts that you copy. Maybe I should be more trusting, but with Microsoft sometimes it is hard.
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: Maybe I should be more trusting, but with Microsoft sometimes it is hard.
I know that feeling.
KreativeKai wrote: I would rather use scripts than doing the work by hand.
I think we all would rather do the scripts When Enterprise Manager or SQL Server Management Studio Express generates the scripts, you can place comments into the script and this can serve as an audit point in the life cycle of the project. Always make a backup of the live data before running the scripts. I haven't had any serious trouble with running scripts whenever something is added/changed.
Paul
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
Thanks for your help!!
Lost in the vast sea of .NET
|
|
|
|
|
As long as you are just refreshing data from dev to prod this will work. As Paul says though if you change the schema you will either need to rerun the copy or modify the generated scripts.
only two letters away from being an asset
|
|
|
|