Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recordset

Status
Not open for further replies.

vlad123

Programmer
Joined
Jun 22, 2005
Messages
37
Location
DE
I have a table with a structure like this : {id, url, content}. This content is all the text from a web page(memo). The problem is that I need to look in this content and to find some words and extract them. the table is called Link. I have this code , but it doesnt work. Do you have any suggestions?!
Dim Inhalt As String, rec As Recordset
sqlstr = "SELECT link.content FROM Link WHERE Link.ID = " & Me!cboCombo1.Column(0) & ""
Set rec = db.OpenRecordset(sqlstr)
Inhalt = rec!content

I want to do this for every url that I choose from a combo box.
 
Hi
You do not say in what way this is not working, so a few questions:
In what way is the above not working?
Is db in "db.openrecordset" set to a database?
Are you using a Microsoft Access database - which version?
 
Error:
type mismatch
in here:
Set rec = db.OpenRecordset("SELECT link.content FROM Link WHERE Link.ID = " & Me!Auswahl.Column(0) & "")

Access 2003
I have this line too : Set db = CurrentDb
 
I think perhaps Link.ID is a text field. If this is the case you need to say:
Code:
SELECT link.content FROM Link WHERE Link.ID = [red]'[/red]" & Me!Auswahl.Column(0) & "[red]'[/red]"
Note the single quotes: [red]'[/red]
 
We would need the declarations, too, I'm guessing you'll need to declare explicitly:

[tt]dim rec as dao.recordset
dim db as dao.database[/tt]

If the first column of the combo is also the bound column, it's enough referencing the combo: [tt]me!auswahl[/tt]

There are seven dedicated Access fora, you might want to check them out for your next Access challenge (do a forum search from the top of the page)

Roy-Vidar
 
No, link.id is a AutoNumber. Thanks anyway.
 
So, the bound column of Me!cboCombo1 must be a valid link.ID

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes, it is a valid link.ID. Thanks for all your answers. I will still think of this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top