Hi all :wave:
I have to pc i make a pc as a server and using database in it
But i want that from second pc i can able to excess database that is on the first pc.......
how it is possible :confused:
help urgent!
Printable View
Hi all :wave:
I have to pc i make a pc as a server and using database in it
But i want that from second pc i can able to excess database that is on the first pc.......
how it is possible :confused:
help urgent!
What database are you using?
thanks for reply
i am using ms excess
I wouldn't use MS-Access as a centralized database. I woudl rather choose SQL Server.
Anyways you will have to share the folder where MS-Access database is and you can then use that shared folder to reference the access database from anywhere on your network.
can u tell me in brief what is the concept
Follow the same steps as yyou would follow while creating the DSN on a System and when you need to select the MDB file, goto the shared folder and then select the MDB file you have kept on the server.
Above error is occuring when i am saving the data in the second PC that contain data base that is on the first pcVB Code:
Error(-2147467259):[Microsoft][ODBC Microsoft Access Driver] Operation must use an updatable query
I make a dsn on the first pc and i am accessing the database on the second pc using the first pc dsn
above error is occuring at here
what is the reason?VB Code:
rs.update
Is the database (the mdb file) readonly?
no is is not read only.......
And one more thing, why not just use a simple connectionstring to connect to the database rather than a DSN. It will be easier.
Is the folder in which the mdb file is present read-only? Or do you have read-only access to the shared folder?
folder is not read only
also database is not read only............
and using connection string how i connect the database that is on the other pc ....?
can u have any code.......
thanks
Servername is the name of the server where you have the MDB file, ShareName is the name of the Shared Folder and MDBName is the name of the MDB file.VB Code:
Dim cnDB As ADODB.Connection Set cnDB = New ADODB.Connection cnDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\ServerName\ShareName\MDBname"
just i am checking.............
thnaks
using you code error occuring that database r folder is read only....
what i do..........
Thnaks
error is here
VB Code:
rs.update
Make the folder that the mdb file is in not read only (Properties - down at the bottom). Also, in the Sharing tab, in Permissions, give Everybody Full permission.
@Shuja Ali :wave: completed successfully......... :thumb:
Now give me an idea that there are five pc and five pc sharing the database ....
i want to know that who is currently sharing the database as a server........ :confused:
thanks shuja ali
Your idea are great
@ Al42 :thumb:
thanks 4 suggession.... i get this problem sulution........
@ shuja Ali
Please chek it again
You can't use another pc's DSN. It best to code your app using a DSN-Less connection and you will not have to bother with this problem at all.
I did not understand completely, do you want to know which PC is currently sharing the MDB file?Quote:
Originally Posted by shakti5385
If that is what you are looking for then you will have to write a function that will search the network for all the shared folders and then check if the MDB file is in any of the shared folders.
But IMHO, this should not be done, you might probably rethink about what you are trying to do. If you want to have a centralized database then it should be kept only at one place and then all the other PCs should be accessing the data from this database.
ServerPC is sharing the database.........Quote:
I did not understand completely, do you want to know which PC is currently sharing the MDB file?
Server contain the main database and p1,p2,p3 sharing the server database........Quote:
I did not understand completely, do you want to know which PC is currently sharing the MDB file?
but at a server sight i(server only) want to know that at a time who is accessing the database.........
any idea for it!
Thanks for reply
The easiest way would be to read the LDB file that will be present in the same folder as the MDB file and read the contents. This file will contain the name of the PC and the User who is using the database.
How to do this?VB Code:
read the LDB file
How to show on a form on a command button click that who is accessing the database
.......
Thanks 4 reply
i click on the mdb file but message show that windows can not open this file..........
The how to read it?
or just use ASP on the server with an ASP page that is requested and info sent back and forth .. but then you will need to know some ASP ..
i do not know ASPQuote:
or just use ASP on the server with an ASP page that is requested and info sent back and forth .. but then you will need to know some ASP ..
Open it using Notepad.
And in VB code you can do something similar to thisThis just an example, the actual implementation will depend on what you are going to do with the data that is present in the File.VB Code:
Dim sLine As String Open "C:\db1.ldb" For Input As #1 Line Input #1, sLine Debug.Print sLine Close #1
@Shuja Ali
Great Code........
But Problem Is that is is showing on pc name two time..........
and showing admin there but there is no admin pc name..........
guide me
thanks
Thats the information that you will get from that file.
Do you want to display in the application who is accessing the database? If so then just use Environ("Username") in the code to get the username who is accessing the application currently.
ya i want to display in a list boxQuote:
Do you want to display in the application who is accessing the database?
Not understand tell in brief...Quote:
If so then just use Environ("Username") in the code to get the username who is accessing the application currently.
thanks
I m checking the username and try to saving it in the database in a table,,,,,
but it is not saving error occuring that field is to small or long how to do this,...
please check this code
VB Code:
Public Sub Check_Who_Is_Using_This_Software() TSQL = "" PC_Name = LocalHostName() 'Function giving the machine Name IP_Address = IPAddressFromHostName(PC_Name) 'Function givinfg the ip address TSQL = "" TSQL = "select * from pc where pcname='& Trim(PC_Name) &'" Set RTMP = Get_Special_Record_Set(TSQL) If RTMP.BOF = True And RTMP.EOF = True Then RTMP.AddNew RTMP!pcname = RTrim(PC_Name)' Error occuring here why not saving :confused: the machine name as string RTMP!ip = Trim(IP_Address) RTMP.Update Else RTMP!pcname = Trim(PC_Name) RTMP!ip = Trim(IP_Address) RTMP.Update End If End Sub
Thanks
Please check both post
@shuja Ali
Post 30 slovedby me
can u tell me sonthing about post 29
thanks
What is the error message that you are getting?
If all you need is to display the username in the application then just useto get the Username and put it in the listbox.VB Code:
Environ$("USERNAME")
Or do you want to show it to other users also?
yes i want to show all user at server pc......Quote:
Or do you want to show it to other users also?
thanks 4 reply
Then have a table that will store the Usernames who are accessing the database and then query that table using the application on the server.Quote:
Originally Posted by shakti5385
Although this is not a reliable solution but this is the easiest one to implement.
I am savin all the user name in the table when they log in
and i will delete the user name from the table when they log out...
is this concept is correct
thanks
That sounds ok.
@ Shuja Ali
Thanks a lot for ur great guidence.....
I am not able to rate ur post this time due to some vb forums rules......
Please wait i m send u a image.....
@Shuja ali :wave:
Please check this image :wave:
i done it in ur guidence..... :thumb:
Please keeping guide me :)
Thanks a lot :thumb:
if u have any idea abot my post run in back ground then please tell me....
shakti..... :wave:
[SIZE=7]Thanks a lot[/SIZE] :thumb:
Why it is not reliable solution and what is the relaible solution?Quote:
Although this is not a reliable solution but this is the easiest one to implement.
thanks
It is not reliable because What if the system shuts down while your application is still running, your server will still show that user is connected and things similar to that.
I am also searching for a reliable solution ;)