|
-
Jul 19th, 2006, 06:23 AM
#1
Thread Starter
Just Married
-
Jul 19th, 2006, 07:10 AM
#2
Re: How to use other pc dsn
What database are you using?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 19th, 2006, 07:23 AM
#3
Thread Starter
Just Married
Re: How to use other pc dsn
thanks for reply
i am using ms excess
-
Jul 19th, 2006, 07:32 AM
#4
Re: How to use other pc dsn
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.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 19th, 2006, 07:41 AM
#5
Thread Starter
Just Married
Re: How to use other pc dsn
can u tell me in brief what is the concept
-
Jul 19th, 2006, 08:05 AM
#6
Re: How to use other pc dsn
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.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 19th, 2006, 08:17 AM
#7
Thread Starter
Just Married
Re: How to use other pc dsn
VB Code:
Error(-2147467259):[Microsoft][ODBC Microsoft Access Driver] Operation must use an updatable query
Above error is occuring when i am saving the data in the second PC that contain data base that is on the first pc
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?
-
Jul 19th, 2006, 08:19 AM
#8
Re: How to use other pc dsn
Is the database (the mdb file) readonly?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 19th, 2006, 08:28 AM
#9
Thread Starter
Just Married
Re: How to use other pc dsn
no is is not read only.......
-
Jul 19th, 2006, 08:33 AM
#10
Re: How to use other pc dsn
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?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 19th, 2006, 08:43 AM
#11
Thread Starter
Just Married
Re: How to use other pc dsn
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
-
Jul 19th, 2006, 08:46 AM
#12
Re: How to use other pc dsn
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"
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.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 19th, 2006, 08:51 AM
#13
Thread Starter
Just Married
Re: How to use other pc dsn
just i am checking.............
thnaks
-
Jul 19th, 2006, 08:58 AM
#14
Thread Starter
Just Married
Re: How to use other pc dsn
using you code error occuring that database r folder is read only....
what i do..........
Thnaks
error is here
-
Jul 19th, 2006, 10:06 AM
#15
Re: How to use other pc dsn
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.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jul 20th, 2006, 12:01 AM
#16
Thread Starter
Just Married
-
Jul 20th, 2006, 01:42 AM
#17
Thread Starter
Just Married
Re: How to use other pc dsn
@ shuja Ali
Please chek it again
-
Jul 20th, 2006, 01:45 AM
#18
Re: How to use other pc dsn
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.
-
Jul 20th, 2006, 01:45 AM
#19
Re: How to use other pc dsn
 Originally Posted by shakti5385
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........ 
I did not understand completely, do you want to know which PC is currently sharing the MDB file?
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.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 20th, 2006, 01:54 AM
#20
Thread Starter
Just Married
Re: How to use other pc dsn
I did not understand completely, do you want to know which PC is currently sharing the MDB file?
ServerPC is sharing the database.........
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........
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
-
Jul 20th, 2006, 02:01 AM
#21
Re: How to use other pc dsn
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.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 20th, 2006, 02:14 AM
#22
Thread Starter
Just Married
Re: How to use other pc dsn
How to do this?
How to show on a form on a command button click that who is accessing the database
.......
Thanks 4 reply
-
Jul 20th, 2006, 02:18 AM
#23
Thread Starter
Just Married
Re: How to use other pc dsn
i click on the mdb file but message show that windows can not open this file..........
The how to read it?
-
Jul 20th, 2006, 02:24 AM
#24
PowerPoster
Re: How to use other pc dsn
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 ..
-
Jul 20th, 2006, 02:29 AM
#25
Thread Starter
Just Married
Re: How to use other pc dsn
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 ASP
-
Jul 20th, 2006, 02:29 AM
#26
Re: How to use other pc dsn
Open it using Notepad.
And in VB code you can do something similar to this
VB Code:
Dim sLine As String
Open "C:\db1.ldb" For Input As #1
Line Input #1, sLine
Debug.Print sLine
Close #1
This just an example, the actual implementation will depend on what you are going to do with the data that is present in the File.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 20th, 2006, 02:41 AM
#27
Thread Starter
Just Married
Re: How to use other pc dsn
@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
-
Jul 20th, 2006, 02:54 AM
#28
Re: How to use other pc dsn
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.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 20th, 2006, 03:03 AM
#29
Thread Starter
Just Married
Re: How to use other pc dsn
Do you want to display in the application who is accessing the database?
ya i want to display in a list box
If so then just use Environ("Username") in the code to get the username who is accessing the application currently.
Not understand tell in brief...
thanks
-
Jul 20th, 2006, 03:19 AM
#30
Thread Starter
Just Married
Re: How to use other pc dsn
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
Last edited by shakti5385; Jul 20th, 2006 at 03:22 AM.
-
Jul 20th, 2006, 04:16 AM
#31
Thread Starter
Just Married
Re: How to use other pc dsn
@shuja Ali
Post 30 slovedby me
can u tell me sonthing about post 29
thanks
-
Jul 20th, 2006, 04:19 AM
#32
Re: How to use other pc dsn
What is the error message that you are getting?
If all you need is to display the username in the application then just use to get the Username and put it in the listbox.
Or do you want to show it to other users also?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 20th, 2006, 04:29 AM
#33
Thread Starter
Just Married
Re: How to use other pc dsn
Or do you want to show it to other users also?
yes i want to show all user at server pc......
thanks 4 reply
-
Jul 20th, 2006, 04:34 AM
#34
Re: How to use other pc dsn
 Originally Posted by shakti5385
yes i want to show all user at server pc......
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.
Although this is not a reliable solution but this is the easiest one to implement.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 20th, 2006, 04:42 AM
#35
Thread Starter
Just Married
Re: How to use other pc dsn
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
-
Jul 20th, 2006, 04:46 AM
#36
Re: How to use other pc dsn
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 20th, 2006, 05:13 AM
#37
Thread Starter
Just Married
Re: How to use other pc dsn
@ 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.....
-
Jul 20th, 2006, 05:21 AM
#38
Thread Starter
Just Married
-
Jul 20th, 2006, 05:28 AM
#39
Thread Starter
Just Married
Re: How to use other pc dsn
Although this is not a reliable solution but this is the easiest one to implement.
Why it is not reliable solution and what is the relaible solution?
thanks
-
Jul 20th, 2006, 05:37 AM
#40
Re: How to use other pc dsn
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
Use [code] source code here[/code] tags when you post source code.
My Articles
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|