Showing posts with label ineed. Show all posts
Showing posts with label ineed. Show all posts

Friday, March 23, 2012

How to make a single database from two databases ....

Hi ...

I have two separete databases, what Ineed is that I want to make a single database of the two. Although all the table definitions of both the database are same.

I will be glad to know "how to make a single database from two" and i will be happy to see the query to insert the values from one database to another one.

Abdul Ghaffar


That depends on the schema definition, do you have constraints enabled which should be treated the right sequence ? Do you want to import the data automatically ? YOu might have an eye on the DTS packages as they are able to do this and additionally enable the identity insert for you if specified and needed (and if the identities do not interfer with the other database). For my opinion merging two database is not a straight forward automatical process. There is always much manual work needed to do this with a 100% result.


HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

Wednesday, March 21, 2012

How to loop through this sql table and display in ms access listbox

I have a table in SQL, that I know how to connect to using ADO, but I
need help on how to read records from that table.

So on a form I have a listbox where I want to populate that and i have
a textbox with a userid.

Here is an example of the table:
USER ID TYPE PAYMENT
=====================
0001 CARD 150.00
0001 CASH 250.00
0002 CASH 175.00

If I have 0001 in the txtuserid textbox, I then want to display in
the listbox:
CARD 150.00
CASH 250.00

How would I do this?

thanksRon (pts4560@.yahoo.com) writes:

Quote:

Originally Posted by

I have a table in SQL, that I know how to connect to using ADO, but I
need help on how to read records from that table.
>
So on a form I have a listbox where I want to populate that and i have
a textbox with a userid.
>
>
Here is an example of the table:
USER ID TYPE PAYMENT
>=====================
0001 CARD 150.00
0001 CASH 250.00
0002 CASH 175.00
>
>
If I have 0001 in the txtuserid textbox, I then want to display in
the listbox:
CARD 150.00
CASH 250.00
>
How would I do this?


Set cmd = CreateObject("ADODB.Command")
Set cmd.ActiveConnection = cnn
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT TYPE, PAYMENT FROM tbl WHERE USER_ID = ?"
cmd.Parameters.Append CreateParameter("@.userid", adInteger. _
adParamInput, , txtuserid.text)
rs = cmd.Execute

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx